ExamGecko
Question list
Search
Search

List of questions

Search

Related questions











Question 3 - DCA discussion

Report
Export

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 -constraint networking.protocol.udp=true dns-cache'

A.

Yes

Answers
A.

Yes

B.

No

Answers
B.

No

Suggested answer: B

Explanation:

The commanddocker service create -name dns-cache -p 53:53 -constraint networking.protocol.udp=true dns-cachewill not create a swarm service that only listens on port 53 using the UDP protocol. This command has several syntax errors and invalid options.The correct syntax for creating a swarm service isdocker service create [OPTIONS] IMAGE [COMMAND] [ARG...]1.The correct options for specifying the service name, port mapping, and network mode are--name,--publish, and--networkrespectively1. The option-constraintis not a valid option for thedocker service createcommand.To create a swarm service that only listens on port 53 using the UDP protocol, you need to use the--publishoption with theprotocol=udpandmode=hostparameters, and the--networkoption with thehostvalue23.For example, the following command creates a global service using host mode and bypassing the routing mesh2:

docker service create --name dns-cache \

--publish published=53,target=53,protocol=udp,mode=host \

--mode global \

--network host \

dns-cache

1: docker service create | Docker Docs

2: Use swarm mode routing mesh | Docker Docs

3: Manage swarm service networks | Docker Docs

asked 08/11/2024
Vyas Dookhun
31 questions
User
Your answer:
0 comments
Sorted by

Leave a comment first