Последняя активность 1725038410

Inspect all docker volumes

docker-volume.sh Исходник
1docker volume ls | awk 'NR > 1 {print $2}' | xargs docker volume inspect
image-volumes.sh Исходник
1docker ps | awk 'NR > 1 {print $1}' | xargs docker inspect -f '{{ .Mounts }}'
ls-all-volumes.sh Исходник
1docker volume ls | awk 'NR > 1 {print $2}' | xargs docker volume inspect | jq ".[].Mountpoint" | xargs sudo ls -la
readme.md Исходник

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 }]