forked from TommyLau/docker-ocserv
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathDockerfile
70 lines (62 loc) · 1.67 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
67
68
69
70
#
# Dockerfile for ocserv
#
FROM alpine:3.18
ARG OC_VERSION="1.2.3"
RUN buildDeps=" \
g++ \
gnutls-dev \
gpgme \
libev-dev \
libnl3-dev \
libseccomp-dev \
linux-headers \
linux-pam-dev \
lz4-dev \
make \
readline-dev \
tar \
xz \
"; \
set -x \
&& apk add --update --virtual .build-deps $buildDeps \
&& apk add curl gnutls-utils iptables \
&& curl -SL "ftp://ftp.infradead.org/pub/ocserv/ocserv-$OC_VERSION.tar.xz" -o ocserv.tar.xz \
&& curl -SL "ftp://ftp.infradead.org/pub/ocserv/ocserv-$OC_VERSION.tar.xz.sig" -o ocserv.tar.xz.sig \
&& curl -SL "http://ocserv.gitlab.io/www/96865171.asc" -o 96865171.asc \
&& gpg --import 96865171.asc \
&& gpg --verify ocserv.tar.xz.sig \
&& rm 96865171.asc \
&& 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 \
&& make install \
&& mkdir -p /etc/ocserv \
&& cd / \
&& rm -rf /usr/src/ocserv \
&& runDeps="$( \
scanelf --needed --nobanner /usr/local/sbin/ocserv \
| awk '{ gsub(/,/, "\nso:", $2); print "so:" $2 }' \
| xargs -r apk info --installed \
| sort -u \
)" \
&& apk add --virtual .run-deps $runDeps \
&& apk del .build-deps \
&& apk add libnl3 libseccomp lz4-libs readline \
&& rm -rf /var/cache/apk
WORKDIR /etc/ocserv
COPY ocserv.init /etc/ocserv/ocserv.init
COPY All /etc/ocserv/config-per-group/All
COPY docker-entrypoint.sh /entrypoint.sh
ENV PORT 443
ENV IPV4 10.10.10.0
ENV IPV4MASK 255.255.255.0
ENV DNS 1.1.1.1
ENV DNS2 1.0.0.1
EXPOSE $PORT/tcp
EXPOSE $PORT/udp
ENTRYPOINT ["/entrypoint.sh"]
CMD ["ocserv", "-c", "/etc/ocserv/ocserv.conf", "-f"]