-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy patheasy-rsa.multiarch.alpine.Dockerfile
53 lines (44 loc) · 1.99 KB
/
easy-rsa.multiarch.alpine.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
FROM alpine:latest
SHELL ["/bin/sh", "-euxo", "pipefail", "-c"]
ARG VCS_REF
ARG BUILD_DATE
ARG VERSION
ENV EASYRSA_PKI="/easyrsa/pki"
LABEL org.opencontainers.image.title="easy-rsa" \
org.opencontainers.image.authors="OpenVPN development community, Tobias Hargesheimer <[email protected]>" \
org.opencontainers.image.version="${VERSION}" \
org.opencontainers.image.created="${BUILD_DATE}" \
org.opencontainers.image.revision="${VCS_REF}" \
org.opencontainers.image.description="easy-rsa is a CLI utility to build and manage a PKI CA." \
org.opencontainers.image.licenses="GPLv2" \
org.opencontainers.image.url="https://hub.docker.com/r/tobi312/tools" \
org.opencontainers.image.source="https://github.com/OpenVPN/easy-rsa"
RUN apk --no-cache add \
bash \
tzdata \
openssl \
; \
addgroup --gid 1000 easyrsa ; \
adduser --system --shell /bin/sh --uid 1000 --ingroup easyrsa --home /easyrsa easyrsa
#RUN apk --no-cache add \
# easy-rsa \
# easy-rsa-doc \
# ; \
# ln -s /usr/share/easy-rsa/easyrsa /usr/local/bin/easyrsa
RUN apk add --no-cache --virtual .build-deps \
curl \
ca-certificates \
; \
VERSION=${VERSION:-$(curl -s https://api.github.com/repos/OpenVPN/easy-rsa/releases/latest | grep 'tag_name' | cut -d\" -f4 | egrep -o "([0-9]{1,}\.)+[0-9]{1,}")} ; \
echo "EASY_RSA_VERSION=${VERSION}" ; \
EASY_RSA_PATH="/usr/share/easy-rsa" ; \
mkdir -p ${EASY_RSA_PATH} ; \
INSTALL_FILES="EasyRSA-${VERSION}/easyrsa EasyRSA-${VERSION}/openssl-easyrsa.cnf EasyRSA-${VERSION}/vars.example EasyRSA-${VERSION}/x509-types" ; \
curl -sL https://github.com/OpenVPN/easy-rsa/releases/download/v${VERSION}/EasyRSA-${VERSION}.tgz | tar xfz - --strip-components=1 $INSTALL_FILES -C ${EASY_RSA_PATH} ; \
ln -s ${EASY_RSA_PATH}/easyrsa /usr/local/bin/easyrsa ; \
apk del --no-network --purge .build-deps
USER easyrsa
WORKDIR /easyrsa
VOLUME /easyrsa
ENTRYPOINT ["easyrsa"]
CMD ["help"]