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
Chau
9 hours agoColette
6 days agoLouvenia
11 days agoRodolfo
16 days agoCarin
21 days agoLamonica
26 days agoEmelda
1 month agoPa
1 month agoClemencia
1 month agoGenevive
2 months agoKina
2 months agoErin
2 months agoTrinidad
2 months agoStefany
2 months agoKing
2 months agoLayla
3 months agoShelton
3 months agoHollis
3 months agoElizabeth
3 months ago