Deal of The Day! Hurry Up, Grab the Special Discount - Save 25% - Ends In 00:00:00 Coupon code: SAVE25
Welcome to Pass4Success

- Free Preparation Discussions

Docker DCA Exam - Topic 1 Question 119 Discussion

Actual exam question for Docker's DCA exam
Question #: 119
Topic #: 1
[All DCA Questions]

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"

Show Suggested Answer Hide Answer
Suggested Answer: B

= 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


Contribute your Thoughts:

0/2000 characters
Dacia
1 day ago
I’m leaning towards B) No. It might not work as expected.
upvoted 0 times
...
Honey
6 days ago
I feel it's A) Yes. The command looks correct.
upvoted 0 times
...
Ernestine
11 days ago
But what if the service fails? Is it still valid?
upvoted 0 times
...
Augustine
17 days ago
Definitely A) Yes. Port mapping is clear.
upvoted 0 times
...
Alva
22 days ago
I agree, but it could be misleading.
upvoted 0 times
...
Janey
27 days ago
Yup, that's how you set up a DNS service!
upvoted 0 times
...
Chau
2 months ago
Seems right, but I thought it needed TCP too.
upvoted 0 times
...
Colette
2 months ago
Wait, is it really only UDP?
upvoted 0 times
...
Louvenia
2 months ago
Definitely creates a service for DNS.
upvoted 0 times
...
Rodolfo
2 months ago
Yes, it maps port 53 for UDP.
upvoted 0 times
...
Carin
2 months ago
Wait, does this mean I can't use my microwave while the DNS service is running? Asking for a friend.
upvoted 0 times
...
Lamonica
2 months ago
A) Yes, the command creates a swarm service that listens on port 53 using UDP. Easy peasy!
upvoted 0 times
...
Emelda
3 months ago
B) No, this command doesn't create a swarm service. It creates a container with the name "dns-cache" that listens on port 53 using UDP.
upvoted 0 times
...
Pa
3 months ago
I believe the command does create a service for port 53, but I need to double-check if it only listens on UDP as stated.
upvoted 0 times
...
Clemencia
3 months ago
I'm a bit confused about the `-name` flag; I thought it was supposed to be `--name`. Does that affect the command?
upvoted 0 times
...
Genevive
3 months ago
I remember practicing a similar question, and I think the port mapping looks right for a swarm service.
upvoted 0 times
...
Kina
3 months ago
The command looks straightforward to me. The -p 53:53/udp part clearly indicates it's listening on UDP port 53, so I'll select A for this one.
upvoted 0 times
...
Erin
3 months ago
Wait, I'm a little confused. Does the "dns-cache" part mean it's a specific DNS caching service, or is that just the name of the service? I want to make sure I understand the full context before answering.
upvoted 0 times
...
Trinidad
4 months ago
Okay, I'm pretty confident this command sets up a UDP service on port 53. The -p 53:53/udp part seems to specify that. I'll go with A.
upvoted 0 times
...
Stefany
4 months ago
I think the command is correct since it specifies the UDP protocol, but I'm not entirely sure about the syntax.
upvoted 0 times
...
King
4 months ago
Looks good to me! Now I can finally stop using my neighbor's WiFi password.
upvoted 0 times
...
Layla
4 months ago
I think it's A) Yes. It specifies UDP.
upvoted 0 times
...
Shelton
4 months ago
Yes, this command creates a swarm service that listens on port 53 using the UDP protocol.
upvoted 0 times
...
Hollis
5 months ago
Hmm, I'm not totally sure about this one. The command looks right, but I want to double-check the documentation to be certain. I'll have to think it through a bit more.
upvoted 0 times
...
Elizabeth
5 months ago
I think this command does create a swarm service that listens on port 53 using UDP, so I'll go with A.
upvoted 0 times
...

Save Cancel