-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
66 lines (60 loc) · 1.79 KB
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
ARG ALPINE_VERSION=3.20
FROM --platform=${TARGETPLATFORM:-linux/amd64} alpine:${ALPINE_VERSION}
ENV OC_VERSION=1.3.0
RUN buildDeps=" \
curl \
g++ \
gnutls-dev \
gpgme \
libev-dev \
libnl3-dev \
libseccomp-dev \
linux-headers \
linux-pam-dev \
lz4-dev \
make \
readline-dev \
tar \
xz \
"; echo "${buildDeps}" \
&& set -x \
&& apk add --update --no-cache --purge --clean-protected --virtual .build-deps ${buildDeps} \
&& curl -SL "ftp://ftp.infradead.org/pub/ocserv/ocserv-${OC_VERSION}.tar.xz" -o ocserv.tar.xz \
&& mkdir -p /usr/src/ocserv \
&& tar -xf ocserv.tar.xz -C /usr/src/ocserv --strip-components=1 \
&& rm ocserv.tar.xz* \
&& cd /usr/src/ocserv \
&& ./configure \
&& make -j"$(nproc)" \
&& make install \
&& mkdir -p /etc/ocserv \
&& cp /usr/src/ocserv/doc/profile.xml /etc/ocserv/profile.xml \
&& cp /usr/src/ocserv/doc/sample.config /etc/ocserv/ocserv.conf \
&& rm -rf /usr/src/ocserv \
&& runDeps="$( \
(scanelf --needed --nobanner /usr/local/bin/occtl; \
scanelf --needed --nobanner /usr/local/bin/ocpasswd; \
scanelf --needed --nobanner /usr/libexec/ocserv-fw; \
scanelf --needed --nobanner /usr/local/sbin/ocserv; \
scanelf --needed --nobanner /usr/local/sbin/ocserv-worker) \
| awk '{ gsub(/,/, "\nso:", $2); print "so:" $2 }' \
| xargs -r apk info --installed \
| sort -u \
)"; echo "${runDeps}" \
&& apk del --purge .build-deps \
&& apk add --no-cache --purge --clean-protected --virtual .run-deps ${runDeps} \
&& runExtras=" \
curl \
iproute2 \
iptables \
iptables-legacy \
iputils-ping \
net-tools \
openssl \
vlan \
"; echo "${runExtras}"\
&& apk add --no-cache --purge --clean-protected --virtual .run-extras ${runExtras}
WORKDIR /etc/ocserv
EXPOSE 443
EXPOSE 4443/udp
CMD ["ocserv", "-c", "/etc/ocserv/ocserv.conf", "-f"]