ExamGecko
Question list
Search
Search

List of questions

Search

Related questions











Question 60 - DCA discussion

Report
Export

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

Solution: 'docker container inspect nginx'

A.

Yes

Answers
A.

Yes

B.

No

Answers
B.

No

Suggested answer: A

Explanation:

= The commanddocker container inspect nginxwill display a list of volumes for the specific container named nginx.The output of the command will include a section called ''Mounts'' that shows the source, destination, mode, type, and propagation of each volume mounted in the container1.For example, the following output shows that the container nginx has two volumes: one is a bind mount from the host's /var/log/nginx directory to the container's /var/log/nginx directory, and the other is an anonymous volume created by Docker at /var/lib/docker/volumes/... and mounted to the container's /etc/nginx/conf.d directory2.

'Mounts': [

{

'Type': 'bind',

'Source': '/var/log/nginx',

'Destination': '/var/log/nginx',

'Mode': 'rw',

'RW': true,

'Propagation': 'rprivate'

},

{

'Type': 'volume',

'Name': 'f6eb3dfdd57b7e632f6329a6d9bce75a1e8ffdf94498e5309c6c81a87832c28d',

'Source': '/var/lib/docker/volumes/f6eb3dfdd57b7e632f6329a6d9bce75a1e8ffdf94498e5309c6c81a87832c28d/_data',

'Destination': '/etc/nginx/conf.d',

'Driver': 'local',

'Mode': '',

'RW': true,

'Propagation': ''

}

]

docker container inspect

List volumes of Docker container

asked 08/11/2024
Christie Clark
40 questions
User
Your answer:
0 comments
Sorted by

Leave a comment first