diff --git a/Dockerfile b/Dockerfile index 44f1c6f..e130967 100644 --- a/Dockerfile +++ b/Dockerfile @@ -5,7 +5,12 @@ FROM ubuntu:14.04 MAINTAINER Kyle Manna RUN apt-get install -y openvpn iptables curl + ADD ./bin /usr/local/sbin +RUN chmod a+x /usr/local/sbin/* + VOLUME /etc/openvpn + EXPOSE 443/tcp 1194/udp 8080/tcp -CMD run + +ENTRYPOINT ["openvpn.sh"] diff --git a/bin/openvpn.sh b/bin/openvpn.sh new file mode 100755 index 0000000..00efc39 --- /dev/null +++ b/bin/openvpn.sh @@ -0,0 +1,25 @@ +#!/bin/bash +# +# OpenVPN + Docker Wrapper Script +# + +set -ex + +abort() { + echo "Error: $@" + exit 1 +} + +if [ $# -lt 1 ]; then + abort "No command specified" +fi + +# Read arguments from command line +cmd=$1 +shift + +case "$cmd" in + *) + abort "Unknown cmd \"$cmd\"" + ;; +esac