Does this command create a swarm service that only listens on port 53 using the UDP protocol?
Solution. 'docker service create -name dns-cache -p 53:53/udp dns-cache"
= The command 'docker service create -name dns-cache -p 53:53/udp dns-cache' is not correct and will not create a swarm service that only listens on port 53 using the UDP protocol. There are two errors in the command:
The option-nameshould be--namewith two dashes, otherwise it will be interpreted as a short option-nfollowed by an argumentame1.
The option-por--publishwill publish the service port to the host port, which means the service will be reachable from outside the swarm2.To create a service that only listens on the internal network, you need to use the--publish-addoption with themode=ingressflag3.
The correct command should be:
docker service create --name dns-cache --publish-add mode=ingress,target=53,published=53,protocol=udp dns-cache
:
docker service create | Docker Docs
Publish ports on the host | Docker Docs
Publish a port for a service | Docker Docs
Dacia
3 months agoHoney
3 months agoErnestine
3 months agoAugustine
4 months agoAlva
4 months agoJaney
4 months agoChau
5 months agoColette
5 months agoLouvenia
5 months agoRodolfo
5 months agoCarin
5 months agoLamonica
5 months agoEmelda
6 months agoPa
6 months agoClemencia
6 months agoGenevive
6 months agoKina
6 months agoErin
6 months agoTrinidad
7 months agoStefany
7 months agoKing
7 months agoLayla
7 months agoShelton
7 months agoHollis
8 months agoElizabeth
8 months agoLouvenia
2 months agoDaisy
2 months agoShaunna
3 months agoAleisha
3 months agoQueenie
3 months ago