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
1 day agoHoney
6 days agoErnestine
11 days agoAugustine
17 days agoAlva
22 days agoJaney
27 days agoChau
2 months agoColette
2 months agoLouvenia
2 months agoRodolfo
2 months agoCarin
2 months agoLamonica
2 months agoEmelda
3 months agoPa
3 months agoClemencia
3 months agoGenevive
3 months agoKina
3 months agoErin
3 months agoTrinidad
4 months agoStefany
4 months agoKing
4 months agoLayla
4 months agoShelton
4 months agoHollis
5 months agoElizabeth
5 months ago