Debian Codegraph @

filc/Dockerfile

raw
1 FROM --platform=linux/amd64 ubuntu:24.04
2
3 ENV DEBIAN_FRONTEND=noninteractive
4
5 ARG FILC_VERSION=0.678
6 ARG FILC_URL=https://github.com/pizlonator/fil-c/releases/download/v${FILC_VERSION}/optfil-${FILC_VERSION}-linux-x86_64.tar.xz
7
8 RUN apt-get update \
9 && apt-get install -y --no-install-recommends \
10 bash \
11 ca-certificates \
12 cmake \
13 curl \
14 file \
15 gawk \
16 git \
17 iproute2 \
18 make \
19 net-tools \
20 pkg-config \
21 procps \
22 python3 \
23 tar \
24 unzip \
25 xz-utils \
26 && rm -rf /var/lib/apt/lists/*
27
28 # The optfil release tarball wraps a nested fil.tar.xz that extracts to
29 # /opt/fil. We avoid the bundled setup.sh (interactive, attempts SSH/user
30 # setup) and just unpack the inner archive directly. set -eux makes any
31 # failure self-describing in the docker-build log.
32 RUN set -eux; \
33 curl -fL --retry 5 --retry-delay 2 --retry-all-errors --max-time 600 \
34 -o /tmp/optfil-outer.tar.xz "${FILC_URL}"; \
35 ls -la /tmp/optfil-outer.tar.xz; \
36 mkdir -p /tmp/optfil-extract /opt; \
37 tar -C /tmp/optfil-extract -xf /tmp/optfil-outer.tar.xz; \
38 inner=$(ls /tmp/optfil-extract/*/fil.tar.xz | head -n 1); \
39 test -n "${inner}"; \
40 tar -C /opt -xf "${inner}"; \
41 rm -rf /tmp/optfil-outer.tar.xz /tmp/optfil-extract; \
42 test -x /opt/fil/bin/filcc; \
43 /opt/fil/bin/filcc --version
44
45 ENV PATH=/opt/fil/bin:${PATH}
46 ENV CC=filcc
47 ENV CXX=fil++
48 # Make CMake's find_package look at /opt/fil first so coturn links the
49 # Fil-C-built OpenSSL/libevent/sqlite, not the Ubuntu ones.
50 ENV CMAKE_PREFIX_PATH=/opt/fil
51 ENV PKG_CONFIG_PATH=/opt/fil/lib/pkgconfig:/opt/fil/lib64/pkgconfig
52
53 WORKDIR /src
54
55 COPY docker-entrypoint.sh /usr/local/bin/coturn-filc-local
56 COPY build.sh /usr/local/bin/coturn-filc-build
57 RUN chmod +x /usr/local/bin/coturn-filc-local /usr/local/bin/coturn-filc-build
58
59 ENTRYPOINT ["/usr/local/bin/coturn-filc-local"]