forked from TommyLau/docker-ocserv
-
Notifications
You must be signed in to change notification settings - Fork 22
/
Dockerfile
79 lines (70 loc) · 2.03 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
71
72
73
74
75
76
77
78
79
FROM alpine:latest
MAINTAINER MarkusMcNugen
# Forked from TommyLau for unRAID
VOLUME /config
# Install dependencies
RUN buildDeps=" \
curl \
g++ \
gawk \
geoip \
gnutls-dev \
gpgme \
krb5-dev \
libc-dev \
libev-dev \
libnl3-dev \
libproxy \
libseccomp-dev \
libtasn1 \
linux-headers \
linux-pam-dev \
lz4-dev \
make \
oath-toolkit-liboath \
oath-toolkit-libpskc \
p11-kit \
pcsc-lite-libs \
protobuf-c \
readline-dev \
scanelf \
stoken-dev \
tar \
tpm2-tss-esys \
xz \
"; \
set -x \
&& apk add --update --virtual .build-deps $buildDeps \
# The commented out line below grabs the most recent version of OC from the page which may be an unreleased version
# && export OC_VERSION=$(curl --silent "https://ocserv.gitlab.io/www/changelog.html" 2>&1 | grep -m 1 'Version' | awk '/Version/ {print $2}') \
# The line below grabs the 2nd most recent version of OC
&& export OC_VERSION=$(curl --silent "https://ocserv.gitlab.io/www/changelog.html" 2>&1 | grep -m 2 'Version' | tail -n 1 | awk '/Version/ {print $2}') \
&& 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 \
&& make install \
&& 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 --update --virtual .run-deps $runDeps gnutls-utils iptables \
&& apk del .build-deps \
&& rm -rf /var/cache/apk/*
RUN apk add --update bash rsync ipcalc sipcalc ca-certificates rsyslog logrotate runit \
&& rm -rf /var/cache/apk/*
RUN update-ca-certificates
ADD ocserv /etc/default/ocserv
WORKDIR /config
COPY docker-entrypoint.sh /entrypoint.sh
ENTRYPOINT ["/entrypoint.sh"]
EXPOSE 4443
EXPOSE 4443/udp
CMD ["ocserv", "-c", "/config/ocserv.conf", "-f"]