DCA practice question 14 of 25

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"

Full set: 191 questions
Answer options
A: Yes
B: No Correct answer
Correct Answer:
B. No
Explanation

While -p 53:53/udp correctly specifies UDP, the flag for naming a service is --name, not -name. Because Docker CLI treats -n as shorthand for --name only when spelt correctly, the command fails; consequently the described UDP-only service is not created.

Why Incorrect

A. Invalid -name flag prevents service creation; requirement therefore not satisfied.

References

1. Docker Docs – “docker service create” option “--name string Assign a name…” (https://docs.docker.com/engine/reference/commandline/servicecreate/) – Options table.

2. Same page – example of /udp in publish specification.

Scroll to Top