JamesNW
JamesNW

Reputation: 125

In Docker, is there a way to retrieve the image or layer UUID?

I am looking for a way to retrieve the docker container image UUID and the layers UUID. I saw the command 'docker images' and 'docker history' but they do not work on the individual image. Is there a command to do this?

Upvotes: 2

Views: 3551

Answers (2)

e.thompsy
e.thompsy

Reputation: 1377

This is how I did it with a running image: $ docker exec youthful_pike cat /sys/class/dmi/id/product_uuid E2F747AF-0000-0000-AA77-B856C9D179D8

Upvotes: 0

lvthillo
lvthillo

Reputation: 30723

You can find some more information about an image if your perform the following commands:

$ docker images 

mysql                                           latest              2fd136002c22        8 weeks ago         378.4 MB

inspect the imageID or image name

$ docker inspect 2fd136002c22

output:

"RootFS": {
            "Type": "layers",
            "Layers": [
                "sha256:4dcab49015d47e8f300ec33400a02cebc7b54cadd09c37e49eccbc655279da90",
                "sha256:5f70bf18a086007016e948b04aed3b82103a36bea41755b6cddfaf10ace3c6ef",
                "sha256:47bce276c5783a6cfc88e0ac368af70909144d04780222d134090dbf08f897aa",
                "sha256:5f70bf18a086007016e948b04aed3b82103a36bea41755b6cddfaf10ace3c6ef",
                "sha256:093c117bc4d3e1cd6e597a89b1648ebb3543be581c61aba80fc41ff6f7ae8e6d",
                "sha256:1028156f10f1a0f79dba5be05e935d5f4588ebe7c25a3581843f7a759a2d7bfb",
...

and a lot more information like:

"Id": "sha256:2fd136002c22c9017ea24544fc15810aad7d88ab9d53da1063d2805ba0f31e9a",

"Volumes": {
                "/var/lib/mysql": {}
...

Upvotes: 1

Related Questions