Created
March 15, 2015 18:55
-
-
Save c-garcia/12b4d14b9a584164bd53 to your computer and use it in GitHub Desktop.
Start an OpenVPN Container as a systemd managed service under CoreOS
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[Unit] | |
Description=OpenVPN | |
After=docker.service | |
Requires=docker.service | |
[Service] | |
TimeoutStartSec=0 | |
Environment="OVPN_DATA=ovpn-data" | |
Environment="OVPN_IMAGE=kylemanna/openvpn" | |
Environment="OVPN_CONTAINER=openvpn_server" | |
ExecStartPre=-/usr/bin/docker stop ${OVPN_CONTAINER} | |
ExecStartPre=-/usr/bin/docker rm ${OVPN_CONTAINER} | |
ExecStartPre=/usr/bin/docker pull ${OVPN_IMAGE} | |
ExecStart=/usr/bin/docker run --name ${OVPN_CONTAINER} \ | |
--volumes-from ${OVPN_DATA} -p 1194:1194/udp \ | |
--cap-add=NET_ADMIN ${OVPN_IMAGE} | |
ExecStop=/usr/bin/docker stop ${OVPN_CONTAINER} | |
[Install] | |
WantedBy=multi-user.target |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
A data-only container
ovpn-data
provides the directory/etc/openvpn
.