Monday, November 04, 2024

Docker, DNS container startup script

Docker, command line below can not auto start upon server boot up


docker run -d --rm -it --name dnsmasq -v ${PWD}/dnsmasq.d:/etc/dnsmasq.d:ro -v ${PWD}/hosts:/etc/hosts -v ${PWD}/dnsmasq.conf:/etc/dnsmasq.conf -v /var/log/dnsmasq/dnsmasq.log:/var/log/dnsmasq.log -p 53:53/tcp -p 53:53/udp dnsmasq

Changes:
${PWD}  =>  /home/ubuntu/dnsmasq
--rm    =>  --restart unless-stopped 

docker run -d -it --name dnsmasq -v /home/ubuntu/dnsmasq/dnsmasq.d:/etc/dnsmasq.d:ro -v /home/ubuntu/dnsmasq/hosts:/etc/hosts -v /home/ubuntu/dnsmasq/dnsmasq.conf:/etc/dnsmasq.conf -v /var/log/dnsmasq/dnsmasq.log:/var/log/dnsmasq.log -p 53:53/tcp -p 53:53/udp dnsmasq


0 comments: