-
Notifications
You must be signed in to change notification settings - Fork 1
/
Dockerfile
50 lines (43 loc) · 1.5 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
FROM alpine:3.17
ARG TARGETPLATFORM
ARG BUILDPLATFORM
RUN echo "I am running on $BUILDPLATFORM, building for $TARGETPLATFORM"
RUN apk add --no-cache ca-certificates
# Install easyrsa dependencies
RUN apk add --no-cache openssl
WORKDIR /data
ENV EASYRSA=/usr/share/easy-rsa
ENV EASYRSA_PKI=/data/pki
# Install easyrsa
# See: https://github.com/OpenVPN/easy-rsa/tree/master/release-keys
RUN set -eux; \
apk add --no-cache gnupg gpg-agent dirmngr; \
URL=https://github.com/OpenVPN/easy-rsa/releases/download/v3.0.7/EasyRSA-3.0.7.tgz; \
FILE=$( basename $URL ); \
wget -q "$URL"; \
wget -q "$URL.sig"; \
gpg --keyserver keys.openpgp.org --recv-keys 6F4056821152F03B6B24F2FCF8489F839D7367F3; \
gpg --verify "$FILE.sig" "$FILE"; \
mkdir -p /usr/share/easy-rsa; \
tar -zxvf "$FILE" --strip-components=1 -C /usr/share/easy-rsa; \
ln -sf /usr/share/easy-rsa/easyrsa /usr/local/bin/easyrsa; \
\
easyrsa help; \
easyrsa init-pki; \
rm -rfv /data/pki; \
\
rm -fv "$FILE"; \
rm -fv "$FILE.sig"; \
apk del gnupg gpg-agent dirmngr; \
killall dirmngr; \
killall gpg-agent; \
# Fix error: rm: can't remove '/root/.gnupg/S.gpg-agent.extra': No such file or directory
while ls /root/.gnupg/S.* > /dev/null; do \
echo "Waiting for gpg sockets to be removed"; \
sleep 1; \
done; \
rm -rf /root/.gnupg;
VOLUME /data
COPY docker-entrypoint.sh /docker-entrypoint.sh
RUN chmod +x /docker-entrypoint.sh
ENTRYPOINT ["/docker-entrypoint.sh"]