docker Inspection 不结盟运动><>/code>
e.g.,
docker inspect my_container_id
This will give a lot of low-level information about the container, including the bind mounts. Search the output for Mounts
.
实例:
$ docker inspect my_container_name
...
"Mounts": [
{
"Type": "bind",
"Source": "/Users/my_user/my_dir_to_mount",
"Destination": "/my_mount",
"Mode": "",
"RW": true,
"Propagation": "rprivate"
},
{
"Type": "volume",
"Name": "vscode",
"Source": "/var/lib/docker/volumes/vscode/_data",
"Destination": "/vscode",
"Driver": "local",
"Mode": "z",
"RW": true,
"Propagation": ""
}
],
...
"Mounts": [
{
"Type": "bind",
"Source": "/Users/my_user/my_dir_to_mount",
"Target": "/my_mount",
"Consistency": "cached"
},
{
"Type": "volume",
"Source": "vscode",
"Target": "/vscode"
}
],
$ # in gron format ( gron = grep-able JSON :
$ docker inspect my_container_name | gron | grep Mounts
json[0].HostConfig.Mounts = [];
json[0].HostConfig.Mounts[0] = {};
json[0].HostConfig.Mounts[0].Consistency = "cached";
json[0].HostConfig.Mounts[0].Source = "/Users/my_user/my_dir_to_mount";
json[0].HostConfig.Mounts[0].Target = "/my_mount";
json[0].HostConfig.Mounts[0].Type = "bind";
json[0].HostConfig.Mounts[1] = {};
json[0].HostConfig.Mounts[1].Source = "vscode";
json[0].HostConfig.Mounts[1].Target = "/vscode";
json[0].HostConfig.Mounts[1].Type = "volume";
json[0].Mounts = [];
json[0].Mounts[0] = {};
json[0].Mounts[0].Destination = "/my_mount";
json[0].Mounts[0].Mode = "";
json[0].Mounts[0].Propagation = "rprivate";
json[0].Mounts[0].RW = true;
json[0].Mounts[0].Source = "/Users/my_user/my_dir_to_mount";
json[0].Mounts[0].Type = "bind";
json[0].Mounts[1] = {};
json[0].Mounts[1].Destination = "/vscode";
json[0].Mounts[1].Driver = "local";
json[0].Mounts[1].Mode = "z";
json[0].Mounts[1].Name = "vscode";
json[0].Mounts[1].Propagation = "";
json[0].Mounts[1].RW = true;
json[0].Mounts[1].Source = "/var/lib/docker/volumes/vscode/_data";
json[0].Mounts[1].Type = "volume";