docker-volume.sh
· 72 B · Bash
Исходник
docker volume ls | awk 'NR > 1 {print $2}' | xargs docker volume inspect
1 | docker volume ls | awk 'NR > 1 {print $2}' | xargs docker volume inspect |
image-volumes.sh
· 77 B · Bash
Исходник
docker ps | awk 'NR > 1 {print $1}' | xargs docker inspect -f '{{ .Mounts }}'
1 | docker ps | awk 'NR > 1 {print $1}' | xargs docker inspect -f '{{ .Mounts }}' |
ls-all-volumes.sh
· 115 B · Bash
Исходник
docker volume ls | awk 'NR > 1 {print $2}' | xargs docker volume inspect | jq ".[].Mountpoint" | xargs sudo ls -la
1 | docker volume ls | awk 'NR > 1 {print $2}' | xargs docker volume inspect | jq ".[].Mountpoint" | xargs sudo ls -la |
readme.md
· 3.3 KiB · Markdown
Исходник
Inspect all docker volumes
```bash
$ docker volume ls
DRIVER VOLUME NAME
local 2b85855560fe1ca6bf9e28e0a5c56684299154af2abd7ad6e938a98ab2170e8e
local 155b4a28b32892053649ffad905245c0bfa35a5e577741e3d02121c6d50b7911
local a10bfb4492bdb3a9979fb3a292f75c4455e2e554c368c57e232649d971361e0d
local b89ab29344346fe963edb231cbbb6583823552f58069772e4eb27e4a456a8665
```
```bash
$ docker volume ls | awk 'NR > 1 {print $2}'
2b85855560fe1ca6bf9e28e0a5c56684299154af2abd7ad6e938a98ab2170e8e
155b4a28b32892053649ffad905245c0bfa35a5e577741e3d02121c6d50b7911
a10bfb4492bdb3a9979fb3a292f75c4455e2e554c368c57e232649d971361e0d
b89ab29344346fe963edb231cbbb6583823552f58069772e4eb27e4a456a8665
```
```bash
$ docker volume ls | awk 'NR > 1 {print $2}' | xargs docker volume inspect
[
{
"CreatedAt": "2024-07-29T15:41:23Z",
"Driver": "local",
"Labels": {
"com.docker.volume.anonymous": ""
},
"Mountpoint": "/var/lib/docker/volumes/2b85855560fe1ca6bf9e28e0a5c56684299154af2abd7ad6e938a98ab2170e8e/_data",
"Name": "2b85855560fe1ca6bf9e28e0a5c56684299154af2abd7ad6e938a98ab2170e8e",
"Options": null,
"Scope": "local"
},
{
"CreatedAt": "2024-07-29T16:07:35Z",
"Driver": "local",
"Labels": {
"com.docker.volume.anonymous": ""
},
"Mountpoint": "/var/lib/docker/volumes/155b4a28b32892053649ffad905245c0bfa35a5e577741e3d02121c6d50b7911/_data",
"Name": "155b4a28b32892053649ffad905245c0bfa35a5e577741e3d02121c6d50b7911",
"Options": null,
"Scope": "local"
},
{
"CreatedAt": "2024-07-29T15:41:23Z",
"Driver": "local",
"Labels": {
"com.docker.volume.anonymous": ""
},
"Mountpoint": "/var/lib/docker/volumes/a10bfb4492bdb3a9979fb3a292f75c4455e2e554c368c57e232649d971361e0d/_data",
"Name": "a10bfb4492bdb3a9979fb3a292f75c4455e2e554c368c57e232649d971361e0d",
"Options": null,
"Scope": "local"
},
{
"CreatedAt": "2024-07-29T16:07:35Z",
"Driver": "local",
"Labels": {
"com.docker.volume.anonymous": ""
},
"Mountpoint": "/var/lib/docker/volumes/b89ab29344346fe963edb231cbbb6583823552f58069772e4eb27e4a456a8665/_data",
"Name": "b89ab29344346fe963edb231cbbb6583823552f58069772e4eb27e4a456a8665",
"Options": null,
"Scope": "local"
}
]
```
```bash
$ docker ps
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
9e66d4173d07 mlikiowa/napcat-docker:latest "bash entrypoint.sh" 4 weeks ago Up 10 days 0.0.0.0:3001->3001/tcp, :::3001->3001/tcp napcat
```
```bash
$ docker ps | awk 'NR > 1 {print $1}'
9e66d4173d07
```
```bash
$ docker ps | awk 'NR > 1 {print $1}' | xargs docker inspect -f '{{ .Mounts }}'
[{volume 155b4a28b32892053649ffad905245c0bfa35a5e577741e3d02121c6d50b7911 /var/lib/docker/volumes/155b4a28b32892053649ffad905245c0bfa35a5e577741e3d02121c6d50b7911/_data /root/.config/QQ local true } {volume b89ab29344346fe963edb231cbbb6583823552f58069772e4eb27e4a456a8665 /var/lib/docker/volumes/b89ab29344346fe963edb231cbbb6583823552f58069772e4eb27e4a456a8665/_data /usr/src/app/napcat/config local true }]
```
Inspect all docker volumes
$ docker volume ls
DRIVER VOLUME NAME
local 2b85855560fe1ca6bf9e28e0a5c56684299154af2abd7ad6e938a98ab2170e8e
local 155b4a28b32892053649ffad905245c0bfa35a5e577741e3d02121c6d50b7911
local a10bfb4492bdb3a9979fb3a292f75c4455e2e554c368c57e232649d971361e0d
local b89ab29344346fe963edb231cbbb6583823552f58069772e4eb27e4a456a8665
$ docker volume ls | awk 'NR > 1 {print $2}'
2b85855560fe1ca6bf9e28e0a5c56684299154af2abd7ad6e938a98ab2170e8e
155b4a28b32892053649ffad905245c0bfa35a5e577741e3d02121c6d50b7911
a10bfb4492bdb3a9979fb3a292f75c4455e2e554c368c57e232649d971361e0d
b89ab29344346fe963edb231cbbb6583823552f58069772e4eb27e4a456a8665
$ docker volume ls | awk 'NR > 1 {print $2}' | xargs docker volume inspect
[
{
"CreatedAt": "2024-07-29T15:41:23Z",
"Driver": "local",
"Labels": {
"com.docker.volume.anonymous": ""
},
"Mountpoint": "/var/lib/docker/volumes/2b85855560fe1ca6bf9e28e0a5c56684299154af2abd7ad6e938a98ab2170e8e/_data",
"Name": "2b85855560fe1ca6bf9e28e0a5c56684299154af2abd7ad6e938a98ab2170e8e",
"Options": null,
"Scope": "local"
},
{
"CreatedAt": "2024-07-29T16:07:35Z",
"Driver": "local",
"Labels": {
"com.docker.volume.anonymous": ""
},
"Mountpoint": "/var/lib/docker/volumes/155b4a28b32892053649ffad905245c0bfa35a5e577741e3d02121c6d50b7911/_data",
"Name": "155b4a28b32892053649ffad905245c0bfa35a5e577741e3d02121c6d50b7911",
"Options": null,
"Scope": "local"
},
{
"CreatedAt": "2024-07-29T15:41:23Z",
"Driver": "local",
"Labels": {
"com.docker.volume.anonymous": ""
},
"Mountpoint": "/var/lib/docker/volumes/a10bfb4492bdb3a9979fb3a292f75c4455e2e554c368c57e232649d971361e0d/_data",
"Name": "a10bfb4492bdb3a9979fb3a292f75c4455e2e554c368c57e232649d971361e0d",
"Options": null,
"Scope": "local"
},
{
"CreatedAt": "2024-07-29T16:07:35Z",
"Driver": "local",
"Labels": {
"com.docker.volume.anonymous": ""
},
"Mountpoint": "/var/lib/docker/volumes/b89ab29344346fe963edb231cbbb6583823552f58069772e4eb27e4a456a8665/_data",
"Name": "b89ab29344346fe963edb231cbbb6583823552f58069772e4eb27e4a456a8665",
"Options": null,
"Scope": "local"
}
]
$ docker ps
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
9e66d4173d07 mlikiowa/napcat-docker:latest "bash entrypoint.sh" 4 weeks ago Up 10 days 0.0.0.0:3001->3001/tcp, :::3001->3001/tcp napcat
$ docker ps | awk 'NR > 1 {print $1}'
9e66d4173d07
$ docker ps | awk 'NR > 1 {print $1}' | xargs docker inspect -f '{{ .Mounts }}'
[{volume 155b4a28b32892053649ffad905245c0bfa35a5e577741e3d02121c6d50b7911 /var/lib/docker/volumes/155b4a28b32892053649ffad905245c0bfa35a5e577741e3d02121c6d50b7911/_data /root/.config/QQ local true } {volume b89ab29344346fe963edb231cbbb6583823552f58069772e4eb27e4a456a8665 /var/lib/docker/volumes/b89ab29344346fe963edb231cbbb6583823552f58069772e4eb27e4a456a8665/_data /usr/src/app/napcat/config local true }]