Last active
August 3, 2019 19:27
-
-
Save tanelmae/e0cf3b2b7ea8d94ad62240b56eb0aa4d to your computer and use it in GitHub Desktop.
Running CoreDNS docker image with systemd
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=CoreDNS | |
Requires=docker.service | |
After=docker.service | |
ConditionPathExists=/etc/coredns/Corefile | |
[Service] | |
ExecStartPre=/bin/bash -c "/usr/bin/docker container inspect coredns 2> /dev/null || /usr/bin/docker run -d --name coredns -p 53:53/udp --restart unless-stopped -v /etc/coredns:/conf coredns/coredns:1.6.0 -conf /conf/Corefile" | |
ExecStart=/usr/bin/docker start -a coredns | |
ExecStop=/usr/bin/docker stop coredns | |
[Install] | |
WantedBy=multi-user.target |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment