From 3da0efa5bc923c1e297b4eeea53fe3e034508f25 Mon Sep 17 00:00:00 2001 From: Kyle Manna Date: Mon, 7 Sep 2015 19:55:12 -0700 Subject: [PATCH 1/2] alpine: Use alpine as base image instead of Debian * Debian Jessie -> Alpine 3.2: 150MB -> 15MB --- Dockerfile | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/Dockerfile b/Dockerfile index 617a7bb..3eb6f85 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,16 +1,17 @@ # Original credit: https://github.com/jpetazzo/dockvpn # Leaner build then Ubunutu -FROM debian:jessie +FROM alpine:3.2 MAINTAINER Kyle Manna -RUN apt-get update && \ - apt-get install -y openvpn iptables curl && \ - apt-get clean && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* +RUN apk update && \ + apk add openvpn iptables curl bash && \ + rm -rf /tmp/* /var/tmp/* /var/cache/apk/* -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 && \ +RUN mkdir -p /usr/local/share/easy-rsa && cd /usr/local/share/easy-rsa && \ + curl -L https://github.com/OpenVPN/easy-rsa/archive/v3.0.0.tar.gz | tar xzf - easy-rsa-3.0.0/easyrsa3 && \ + mv easy-rsa-3.0.0/easyrsa3 . && rmdir easy-rsa-3.0.0 && \ ln -s /usr/local/share/easy-rsa/easyrsa3/easyrsa /usr/local/bin # Needed by scripts From 23f66094ff932d03411b8dc41585909ee88d2d4c Mon Sep 17 00:00:00 2001 From: Kyle Manna Date: Tue, 8 Sep 2015 10:10:01 -0700 Subject: [PATCH 2/2] alpine: Use easy-rsa in testing branch of alpine * Simplifes the Dockerfile significantly. * No need for curl. --- Dockerfile | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/Dockerfile b/Dockerfile index 3eb6f85..e38ebba 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,22 +1,18 @@ # Original credit: https://github.com/jpetazzo/dockvpn -# Leaner build then Ubunutu +# Leaner build then Ubuntu FROM alpine:3.2 MAINTAINER Kyle Manna -RUN apk update && \ - apk add openvpn iptables curl bash && \ +RUN echo "http://dl-4.alpinelinux.org/alpine/edge/testing/" >> /etc/apk/repositories && \ + apk add --update openvpn iptables bash easy-rsa && \ + ln -s /usr/share/easy-rsa/easyrsa /usr/local/bin && \ rm -rf /tmp/* /var/tmp/* /var/cache/apk/* -RUN mkdir -p /usr/local/share/easy-rsa && cd /usr/local/share/easy-rsa && \ - curl -L https://github.com/OpenVPN/easy-rsa/archive/v3.0.0.tar.gz | tar xzf - easy-rsa-3.0.0/easyrsa3 && \ - mv easy-rsa-3.0.0/easyrsa3 . && rmdir easy-rsa-3.0.0 && \ - ln -s /usr/local/share/easy-rsa/easyrsa3/easyrsa /usr/local/bin - # 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