1
2
mirror of https://github.com/vimagick/dockerfiles synced 2024-06-25 16:28:40 +00:00
dockerfiles/strongswan/Dockerfile

27 lines
594 B
Docker
Raw Normal View History

2016-06-27 19:16:42 +00:00
#
# Dockerfile for ipsec
#
FROM alpine
MAINTAINER kev <noreply@easypi.info>
RUN set -xe \
&& apk add --no-cache iptables openssl strongswan util-linux \
&& ln -sf /etc/ipsec.d/ipsec.conf /etc/ipsec.conf \
&& ln -sf /etc/ipsec.d/ipsec.secrets /etc/ipsec.secrets
COPY init.sh /
VOLUME /etc/ipsec.d /etc/strongswan.d
ENV VPN_SUBNET=10.20.30.0/24
2016-06-27 20:39:35 +00:00
ENV VPN_DNS=8.8.8.8,8.8.4.4
2016-06-27 19:16:42 +00:00
EXPOSE 500/udp 4500/udp
CMD set -xe \
&& /init.sh \
2016-06-28 21:43:41 +00:00
&& rm -f /var/run/starter.charon.pid \
2016-06-27 19:16:42 +00:00
&& iptables -t nat -A POSTROUTING -s $VPN_SUBNET -o eth0 -j MASQUERADE \
&& ipsec start --nofork