Back to Alpine Linux using packaged version of google-authenticator

This commit is contained in:
Fabio Napoleoni 2016-02-11 18:10:51 +01:00
parent ba7b925a9f
commit d481313311
2 changed files with 9 additions and 11 deletions

View File

@ -1,21 +1,19 @@
# Original credit: https://github.com/jpetazzo/dockvpn
# Leaner build then Ubunutu
FROM debian:jessie
# Smallest base image
FROM alpine:3.2
MAINTAINER Kyle Manna <kyle@kylemanna.com>
RUN apt-get update && \
apt-get install -y openvpn iptables curl libpam-google-authenticator && \
apt-get clean && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
RUN mkdir -p /usr/local/share/easy-rsa && \
curl -L https://github.com/OpenVPN/easy-rsa/archive/v3.0.0.tar.gz | tar xzf - --strip=1 -C /usr/local/share/easy-rsa easy-rsa-3.0.0/easyrsa3 && \
ln -s /usr/local/share/easy-rsa/easyrsa3/easyrsa /usr/local/bin
RUN echo "http://dl-4.alpinelinux.org/alpine/edge/community/" >> /etc/apk/repositories && \
echo "http://dl-4.alpinelinux.org/alpine/edge/testing/" >> /etc/apk/repositories && \
apk add --update openvpn iptables bash easy-rsa openvpn-auth-pam google-authenticator && \
ln -s /usr/share/easy-rsa/easyrsa /usr/local/bin && \
rm -rf /tmp/* /var/tmp/* /var/cache/apk/*
# Needed by scripts
ENV OPENVPN /etc/openvpn
ENV EASYRSA /usr/local/share/easy-rsa/easyrsa3
ENV EASYRSA /usr/share/easy-rsa
ENV EASYRSA_PKI $OPENVPN/pki
ENV EASYRSA_VARS_FILE $OPENVPN/vars

View File

@ -241,7 +241,7 @@ done
# Optional OTP authentication support
if [ -n "$OVPN_OTP_AUTH" ]; then
echo -e "\n\n# Enable OTP+PAM for user authentication" >> "$conf"
echo "plugin /usr/lib/openvpn/openvpn-plugin-auth-pam.so openvpn" >> "$conf"
echo "plugin /usr/lib/openvpn/plugins/openvpn-plugin-auth-pam.so openvpn" >> "$conf"
fi
set +e