-
Notifications
You must be signed in to change notification settings - Fork 2
/
Dockerfile
60 lines (51 loc) · 1.39 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
FROM alpine:3.7
MAINTAINER Henry <hyliang8497@gmail.com>
ENV OC_VERSION=0.12.1
WORKDIR /root/
COPY ocserv ocserv
COPY create_user.sh /usr/local/sbin/create_ocserv_user.sh
COPY docker-entrypoint.sh /entrypoint.sh
RUN buildDeps=" \
curl \
wget \
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 \
&& 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 \
&& gpg --keyserver pgp.mit.edu --recv-key 96865171 \
&& gpg --verify ocserv.tar.xz.sig \
&& 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 -fr /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 gnutls-utils iptables \
&& apk del .build-deps \
&& rm -rf /var/cache/apk/*
ENTRYPOINT ["/entrypoint.sh"]
EXPOSE 443
CMD ["ocserv", "-c", "/etc/ocserv/ocserv.conf", "-f"]