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
2 months agoHoney
2 months agoErnestine
2 months agoAugustine
2 months agoAlva
2 months agoJaney
2 months agoChau
3 months agoColette
3 months agoLouvenia
3 months agoRodolfo
4 months agoCarin
4 months agoLamonica
4 months agoEmelda
4 months agoPa
4 months agoClemencia
4 months agoGenevive
5 months agoKina
5 months agoErin
5 months agoTrinidad
5 months agoStefany
5 months agoKing
5 months agoLayla
6 months agoShelton
6 months agoHollis
6 months agoElizabeth
6 months agoLouvenia
20 days agoDaisy
25 days agoShaunna
1 month agoAleisha
1 month agoQueenie
1 month ago