ExamGecko
Question list
Search
Search

List of questions

Search

Related questions











Question 46 - 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 -service udp 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 -service udp dns-cacheisnot validbecause it has somesyntax errors. The correct syntax for creating a swarm service isdocker service create [OPTIONS] IMAGE [COMMAND] [ARG...]. The errors in the command are:

There should be a space between theoption flagand theoption value. For example,-name dns-cacheshould be-name dns-cache.

The option flag for specifying theservice modeis-mode, not-service. For example,-service udpshould be-mode udp.

The option flag for specifying theport mappingis--publishor-p, not-p. For example,-p 53:53should be--publish 53:53.

The correct command for creating a swarm service that only listens on port 53 using the UDP protocol is:

docker service create --name dns-cache --publish 53:53/udp dns-cache

This command will create a service calleddns-cachethat uses thedns-cacheimage and exposes port 53 on both the host and the container using the UDP protocol.

asked 08/11/2024
Maher Khamessi
30 questions
User
Your answer:
0 comments
Sorted by

Leave a comment first