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 questionsCorrect 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.
Keep practicing
Take the free DCA practice test
Ten exam-style questions with answers and explanations, plus the exam facts and study guides.
More questions
Other DCA practice questions
- Question 1Does this command create a swarm service that only listens on port 53 using the UDP proto…
- Question 2Will this command ensure that overlay traffic between service tasks is encrypted? Solutio…
- Question 4Does this describe the role of Control Groups (cgroups) when used with a Docker container…
- Question 5Can this set of commands identify the published port(s) for a container? Solution: docker…
- Question 6Will this command mount the host's '/data' directory to the ubuntu container in read-only…
- Question 7A company's security policy specifies that development and production containers must run…
