ExamGecko
Home / Docker / DCA / Practice Test 1
Ask Question

Docker DCA Practice Test 1

Add to Whishlist
00:00:00
Show Answer
Report Issue   Restart test

Question 1 / 40

Will this command display a list of volumes for a specific container?

Solution. 'docker container inspect nginx'

Yes

Yes

No

No

Comment (0)
Suggested answer: B
Explanation:

This command will not display a list of volumes for a specific container, as it will show detailed information on the container itself, such as its configuration, network settings, state, and log path1.To display a list of volumes for a specific container, you need to use the--formatoption with a custom template that filters the output by theMountsfield2. For example, the following command will show the source and destination of the volumes mounted in the nginx container:

docker container inspect --format=' { {range .Mounts}} { {.Source}} -> { {.Destination}} { {end}}' nginxReference:

docker container inspect | Docker Docs

How to Use Docker Inspect Command - Linux Handbook

asked 08/11/2024
Vusani Nedzungani
56 questions