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'
Correct Answer: B
Explanation
= The command docker service create -name dns-cache -p 53:53 -udp dns-cache will not create a swarm service that only listens on port 53 using the UDP protocol. The reason is that the command has several syntax errors and invalid options. The correct command to create a swarm service that only listens on port 53 using the UDP protocol is docker service create --name dns-cache --publish published=53,target=53,protocol=udp dns-cache12. The command docker service create -name dns-cache -p 53:53 -udp dns-cache has the following problems:
* The option -name is not a valid option for docker service create. The valid option for specifying the service name is --name3.
* The option -p is not a valid option for docker service create. The valid option for publishing a port for a service is --publish1.
* The option -udp is not a valid option for docker service create. The valid option for specifying the protocol for a published port is protocol within the --publish option1.
* The argument 53:53 is not a valid argument for docker service create. The argument for docker service create should be the image name for the service, such as dns-cache3. The source and target of the published port should be specified in the --publish option, separated by a comma1.
Therefore, the command docker service create -name dns-cache -p 53:53 -udp dns-cache will not work as intended, and will likely produce an error message or an unexpected result. References:
* Use swarm mode routing mesh
* Manage swarm service networks
* docker service create