Skip to content

Commit

Permalink
Merge pull request #13 from DNXLabs/upgrading_alpine
Browse files Browse the repository at this point in the history
Updating Dockerfile
  • Loading branch information
mvsnogueira-dnx authored Apr 4, 2024
2 parents 347d8dc + 7e23bbe commit fab849d
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 20 deletions.
30 changes: 11 additions & 19 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,44 +1,36 @@
# Original credit: https://github.com/jpetazzo/dockvpn

FROM alpine:3.19.1 as awscli-installer

# Install Python and pip
RUN apk add --no-cache python3 py3-pip && \
python3 -m venv /awscli-venv && \
source /awscli-venv/bin/activate && \
pip install --upgrade pip && \
pip install awscli

# Smallest base image
FROM alpine:3.19.1
# Copy the virtual environment from the previous stage
COPY --from=awscli-installer /awscli-venv /awscli-venv

# Add the virtual environment to PATH so aws-cli commands can be used directly
ENV PATH="/awscli-venv/bin:$PATH"

LABEL maintainer="Kyle Manna <[email protected]>"

# Testing: pamtester
RUN echo "http://dl-cdn.alpinelinux.org/alpine/edge/testing/" >> /etc/apk/repositories && \
apk add --update openvpn iptables bash easy-rsa openvpn-auth-pam google-authenticator pamtester libqrencode && \
ln -s /usr/share/easy-rsa/easyrsa /usr/local/bin && \
rm -rf /tmp/* /var/tmp/* /var/cache/apk/* /var/cache/distfiles/*

ENV AWSCLI_VERSION=1.32.1

RUN apk --no-cache update && \
apk --no-cache add python3 py3-pip py3-setuptools ca-certificates groff less bash make jq gettext-dev curl wget g++ zip git && \
python3 -m venv /awscli-venv && \
source /awscli-venv/bin/activate && \
pip install --no-cache-dir awscli==${AWSCLI_VERSION} && \
deactivate && \
update-ca-certificates && \
rm -rf /var/cache/apk/*

ENV PATH="/awscli-venv/bin:$PATH"


# Needed by scripts
ENV OPENVPN /etc/openvpn
ENV EASYRSA /usr/share/easy-rsa
ENV EASYRSA_PKI $OPENVPN/pki
# ENV EASYRSA_VARS_FILE $OPENVPN/vars

# Prevents refused client connection because of an expired CRL
ENV EASYRSA_CRL_DAYS 3650
ENV EASYRSA=/usr/share/easy-rsa \
EASYRSA_CRL_DAYS=3650 \
EASYRSA_PKI=$OPENVPN/pki

VOLUME ["/etc/openvpn"]

Expand Down
2 changes: 1 addition & 1 deletion Dockerfile.aarch64
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ RUN echo "http://dl-4.alpinelinux.org/alpine/edge/community/" >> /etc/apk/reposi
ENV OPENVPN /etc/openvpn
ENV EASYRSA /usr/share/easy-rsa
ENV EASYRSA_PKI $OPENVPN/pki
ENV EASYRSA_VARS_FILE $OPENVPN/vars
#ENV EASYRSA_VARS_FILE $OPENVPN/vars

# Prevents refused client connection because of an expired CRL
ENV EASYRSA_CRL_DAYS 3650
Expand Down

0 comments on commit fab849d

Please sign in to comment.