Exam4Training

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

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

Solution: ‘docker container inspect nginx’
A . Yes
B . No

Answer: A

Explanation:

= The command docker container inspect nginx will 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/f6eb3dfdd57b7e632f6329a6d9bce75a1e8ffdf94498e5309c6c81a87832c28

d/_data",

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

"Driver": "local",

"Mode": "",

"RW": true,

"Propagation": ""

}

]

Reference: docker container inspect

List volumes of Docker container

Latest DCA Dumps Valid Version with 55 Q&As

Latest And Valid Q&A | Instant Download | Once Fail, Full Refund

Exit mobile version