Get the App
SLTechnology News&Howtos  ›  Development  › 

How to use the docker inspect command to view directory mount information

Shulou Source: shulou.com Published: 2022-06-01 04:10:32 11月16日 Update

This article is about how to use the docker inspect command to view directory mount information. Xiaobian thinks it is quite practical, so share it with everyone for reference. Let's follow Xiaobian and have a look.

View directory mount information

Enter the following command to output the Mounts information of the container. You can see the specific mount locations of the directories in the container on the host.

docker inspect --format="{{json .Mounts}}" container

The json in the parameter is the name of the method in the go language, followed by the jsonization of the value of Mounts. JSON can also be removed.

If you think this input is still not very good, you can further process json, such as using python json module or jq to beautify the output. The order reads as follows:

#Beautify docker inspect with python json module--format="{{json .Mounts}}" container| python -m json.tool#Beautify docker inspect --format="{{json .Mounts}}" container with jq| JQ Thank you for reading! About "how to use docker inspect command to view directory mount information" This article is shared here, I hope the above content can be of some help to everyone, so that everyone can learn more knowledge, if you think the article is good, you can share it to let more people see it!

Tags: Information commands directories contents containers more modules articles processing input output good good-looking practical location parameters hosts hosts articles methods Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno MySQL Linux Shulou Technology NVidia Redmi