Skip to content

Click on each book below to review & buy on Amazon.

As an Amazon Associate, I earn from qualifying purchases.


RHCSA - Manage Containers: Inspect Container Images

There are two methods for inspecting container images, which are by using the skopeo inspect command for remote images or podman inspect for local images.

Inspect Remote Container Images

To inspect remote container images you will need to use the skopeo inspect command, however this may not be installed by default. If it is not available on your system you will need to install the container-tools package:

Install container-tools:

sudo yum -y install container-tools

This will install more than just the skopeo command which is ok:

================================================================================
 Package         Arch   Version          Repository                        Size
================================================================================
Installing:
 container-tools noarch 1-12.el9         rhel-9-for-x86_64-appstream-rpms 9.0 k
Installing dependencies:
 podman-docker   noarch 2:4.4.1-12.el9_2 rhel-9-for-x86_64-appstream-rpms  37 k
 podman-remote   x86_64 2:4.4.1-12.el9_2 rhel-9-for-x86_64-appstream-rpms 9.4 M
 python3-podman  noarch 3:4.4.1-1.el9    rhel-9-for-x86_64-appstream-rpms 175 k
 python3-pyxdg   noarch 0.27-3.el9       rhel-9-for-x86_64-appstream-rpms 108 k
 python3-toml    noarch 0.10.2-6.el9     rhel-9-for-x86_64-appstream-rpms  46 k
 skopeo          x86_64 2:1.11.2-0.1.el9 rhel-9-for-x86_64-appstream-rpms 7.9 M
 toolbox         x86_64 0.0.99.3-9.el9   rhel-9-for-x86_64-appstream-rpms 2.4 M
 udica           noarch 0.2.6-30.el9_1   rhel-9-for-x86_64-appstream-rpms  53 k

Transaction Summary
================================================================================
Install  9 Packages

Once you have confirmed the skopeo command is installed you would run skopeo inspect docker://<registry>/image to inspect a remote image.

Inspect a remote mariadb image from docker.io:

skopeo inspect docker://docker.io/mariadb:latest

The output will be in JSON format similar to the below:

{
    "Name": "docker.io/library/mariadb",
    "Digest": "sha256:5d851e999b84625ef9810589e832686...",
    "RepoTags": [
        "10",
        "10-bionic",
        "10-focal",
        "10-jammy",
        "10-jessie",
        "10.0",
        "10.0-jessie",
        "10.0-xenial",
        "...",
        "...",
        "5.5.64",
        "5.5.64-trusty",
        "alpha",
        "alpha-focal",
        "beta",
        "beta-bionic",
        "beta-focal",
        "bionic",
        "focal",
        "jammy",
        "jessie",
        "latest",
        "lts",
        "lts-jammy",
        "rc",
        "rc-bionic",
        "rc-focal"
    ],
    "Created": "2023-09-02T01:00:25.783115724Z",
    "DockerVersion": "20.10.23",
    "Labels": {
        "org.opencontainers.image.authors": "MariaDB Community",
        "org.opencontainers.image.base.name": "docker.io/library/ubuntu:jammy",
        "org.opencontainers.image.description": "MariaDB Database for relational SQL",
        "org.opencontainers.image.documentation": "https://hub.docker.com/_/mariadb/",
        "org.opencontainers.image.licenses": "GPL-2.0",
        "org.opencontainers.image.ref.name": "ubuntu",
        "org.opencontainers.image.source": "https://github.com/MariaDB/mariadb-docker",
        "org.opencontainers.image.title": "MariaDB Database",
        "org.opencontainers.image.url": "https://github.com/MariaDB/mariadb-docker",
        "org.opencontainers.image.vendor": "MariaDB Community",
        "org.opencontainers.image.version": "11.1.2"
    },
    "Architecture": "amd64",
    "Os": "linux",
    "Layers": [
        "sha256:44ba2882f8eb14264e5f2f9f6ec55bcf5306527b637279f2cd9d4858762388af",
        "sha256:08b8223d0cb63605c13620c5faa1fed71bc203d748f9999eb6ee3f9363a496fb",
        "sha256:ef2696fb09d6dc7e92a790a154e7de9922d8ba322d22f8f44baae2020cfc15bb",
        "sha256:6ae32c298a0dedd83348f175f9614d7e4a822c3668eeb94b9159783f0a926a9d",
        "sha256:5dc97cb97b44a9660013a1b9644f297e168f97d1dfc57153ee7b40192881c5a1",
        "sha256:a3e4bee69a5827f2ca29a1779de03131bd2d082bfdc2cf12e9771884379202cb",
        "sha256:b29c582204c942d4977b982a8834f8e5d6e422635e907b1c6d488676039e2a56",
        "sha256:f05405b8aaeddc89b1ade86660006d35ad6d0e1e887c0fca2efa2f5a8037c01d"
    ],
    "LayersData": [
        {
            "MIMEType": "application/vnd.docker.image.rootfs.diff.tar.gzip",
            "Digest": "sha256:44ba2882f8eb14264e5f2f9f6ec55bcf5306527b637279f2cd9d4858762388af",
            "Size": 30438977,
            "Annotations": null
        },
        {
            "MIMEType": "application/vnd.docker.image.rootfs.diff.tar.gzip",
            "Digest": "sha256:08b8223d0cb63605c13620c5faa1fed71bc203d748f9999eb6ee3f9363a496fb",
            "Size": 1748,
            "Annotations": null
        },
        {
            "MIMEType": "application/vnd.docker.image.rootfs.diff.tar.gzip",
            "Digest": "sha256:ef2696fb09d6dc7e92a790a154e7de9922d8ba322d22f8f44baae2020cfc15bb",
            "Size": 5592652,
            "Annotations": null
        },
        {
            "MIMEType": "application/vnd.docker.image.rootfs.diff.tar.gzip",
            "Digest": "sha256:6ae32c298a0dedd83348f175f9614d7e4a822c3668eeb94b9159783f0a926a9d",
            "Size": 149,
            "Annotations": null
        },
        {
            "MIMEType": "application/vnd.docker.image.rootfs.diff.tar.gzip",
            "Digest": "sha256:5dc97cb97b44a9660013a1b9644f297e168f97d1dfc57153ee7b40192881c5a1",
            "Size": 332,
            "Annotations": null
        },
        {
            "MIMEType": "application/vnd.docker.image.rootfs.diff.tar.gzip",
            "Digest": "sha256:a3e4bee69a5827f2ca29a1779de03131bd2d082bfdc2cf12e9771884379202cb",
            "Size": 87236202,
            "Annotations": null
        },
        {
            "MIMEType": "application/vnd.docker.image.rootfs.diff.tar.gzip",
            "Digest": "sha256:b29c582204c942d4977b982a8834f8e5d6e422635e907b1c6d488676039e2a56",
            "Size": 3566,
            "Annotations": null
        },
        {
            "MIMEType": "application/vnd.docker.image.rootfs.diff.tar.gzip",
            "Digest": "sha256:f05405b8aaeddc89b1ade86660006d35ad6d0e1e887c0fca2efa2f5a8037c01d",
            "Size": 7569,
            "Annotations": null
        }
    ],
    "Env": [
        "PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin",
        "GOSU_VERSION=1.14",
        "LANG=C.UTF-8",
        "MARIADB_VERSION=1:11.1.2+maria~ubu2204"
    ]
}

Inspect Local Container Images

To inspect local container images you will need to use the podman inspect command followed by the image id.

Image ID's are very long strings but you do not have to specify the full string when working with images. As long as you enter the first couple of characters so that no other image ID would match, then you would be ok running a command that way.

Download then inspect the docker.io/mariadb image:

Download the image:

podman pull docker.io/mariadb

Determine the mariadb image ID:

podman images mariadb

The output should will be similar to the below, which in my case shows the image ID as 582c50950661:

REPOSITORY                 TAG         IMAGE ID      CREATED     SIZE
docker.io/library/mariadb  latest      582c50950661  9 days ago  410 MB

Inspect the mariadb image. Note that your image ID may be different and also that I did not type the full image ID:

podman inspect 582c

In comparison to inspecting the image remotely using skopeo, the details available when inspecting an image locally are much greater. You can see details on; ports, environment variables, command that runs, and volumes to name a few:

[
     {
          "Id": "582c509506611afe8e7b60a132b69f8f267df38174d9a56b59ea088690c7ecb3",
          "Digest": "sha256:a104070983c2a9ab542d6142de858457dd15d2cabd7ac26e4ca3891d7721e73e",
          "RepoTags": [
               "docker.io/library/mariadb:latest"
          ],
          "RepoDigests": [
               "docker.io/library/mariadb@sha256:a104070983c2a9ab542d6142de858457dd15d2cabd7ac...",
               "docker.io/library/mariadb@sha256:d4533d297b360c009880cc29d0aa92bffe00c94b3b3c8..."
          ],
          "Parent": "",
          "Comment": "",
          "Created": "2023-08-22T20:30:13.195434751Z",
          "Config": {
               "ExposedPorts": {
                    "3306/tcp": {}
               },
               "Env": [
                    "PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin",
                    "GOSU_VERSION=1.14",
                    "LANG=C.UTF-8",
                    "MARIADB_VERSION=1:11.1.2+maria~ubu2204"
               ],
               "Entrypoint": [
                    "docker-entrypoint.sh"
               ],
               "Cmd": [
                    "mariadbd"
               ],
               "Volumes": {
                    "/var/lib/mysql": {}
               },
               "Labels": {
                    "org.opencontainers.image.authors": "MariaDB Community",
                    "org.opencontainers.image.base.name": "docker.io/library/ubuntu:jammy",
                    "org.opencontainers.image.description": "MariaDB Database for relational SQL",
                    "org.opencontainers.image.documentation": "https://hub.docker.com/_/mariadb/",
                    "org.opencontainers.image.licenses": "GPL-2.0",
                    "org.opencontainers.image.ref.name": "ubuntu",
                    "org.opencontainers.image.source": "https://github.com/MariaDB/mariadb-docker",
                    "org.opencontainers.image.title": "MariaDB Database",
                    "org.opencontainers.image.url": "https://github.com/MariaDB/mariadb-docker",
                    "org.opencontainers.image.vendor": "MariaDB Community",
                    "org.opencontainers.image.version": "11.1.2"
               }
          },
          "Version": "20.10.23",
          "Author": "",
          "Architecture": "amd64",
          "Os": "linux",
          "Size": 410320100,
          "VirtualSize": 410320100,
          "GraphDriver": {
               "Name": "overlay",
               "Data": {
                    "LowerDir": "/home/user1/.local/share/containers/storage/overlay/18a84924778...",
                    "UpperDir": "/home/user1/.local/share/containers/storage/overlay/9d18e32b06a...",
                    "WorkDir": "/home/user1/.local/share/containers/storage/overlay/9d18e32b06a7..."
               }
          },
          "RootFS": {
               "Type": "layers",
               "Layers": [
                    "sha256:bce45ce613d34bff6a3404a4c2d56a5f72640f804c3d0bd67e2cf0bf97cb950c",
                    "sha256:cc32d60606d344bb864d44585b6051ce9233856237478cb9650a91b72267000d",
                    "sha256:45d2610777e2f7372928433f95ee25598f7ab6148b6a3d7e17e46feadf85264e",
                    "sha256:0f6aa0eda4ee7362e833f77e6f33ecb2757caf95ab3e8329d0b7ed7d373ff906",
                    "sha256:40dcf5d8d5ae3ffa40219f0e5bde0096d379562eb93a86411874de3116e884c7",
                    "sha256:e60075fdc1348a460fc618de3d55ea438c54c550761efbf74aba42d6a564322a",
                    "sha256:da54791634a4bffb085a7215e55b7bc64260c860f48f75d9aea5867d3d684beb",
                    "sha256:deacfb66120d0a7729fc776283cf24824c8e5128b86696c2e9ae97cc6262cf24"
               ]
          },
          "Labels": {
               "org.opencontainers.image.authors": "MariaDB Community",
               "org.opencontainers.image.base.name": "docker.io/library/ubuntu:jammy",
               "org.opencontainers.image.description": "MariaDB Database for relational SQL",
               "org.opencontainers.image.documentation": "https://hub.docker.com/_/mariadb/",
               "org.opencontainers.image.licenses": "GPL-2.0",
               "org.opencontainers.image.ref.name": "ubuntu",
               "org.opencontainers.image.source": "https://github.com/MariaDB/mariadb-docker",
               "org.opencontainers.image.title": "MariaDB Database",
               "org.opencontainers.image.url": "https://github.com/MariaDB/mariadb-docker",
               "org.opencontainers.image.vendor": "MariaDB Community",
               "org.opencontainers.image.version": "11.1.2"
          },
          "Annotations": {},
          "ManifestType": "application/vnd.docker.distribution.manifest.v2+json",
          "User": "",
          "History": [
               {
                    "created": "2023-08-04T04:52:57.879530693Z",
                    "created_by": "/bin/sh -c #(nop)  ARG RELEASE",
                    "empty_layer": true
               },
               {
                    "created": "2023-08-04T04:52:57.953208852Z",
                    "created_by": "/bin/sh -c #(nop)  ARG LAUNCHPAD_BUILD_ARCH",
                    "empty_layer": true
               },
               {
                    "created": "2023-08-04T04:52:58.00964157Z",
                    "created_by": "/bin/sh -c #(nop)  LABEL org.opencontainers.image.ref.name=ubuntu",
                    "empty_layer": true
               },
               {
                    "created": "2023-08-04T04:52:58.065341147Z",
                    "created_by": "/bin/sh -c #(nop)  LABEL org.opencontainers.image.version=22.04",
                    "empty_layer": true
               },
               {
                    "created": "2023-08-04T04:52:59.752480671Z",
                    "created_by": "/bin/sh -c #(nop) ADD file:bb1fa1d9d012ae826908afdce8c9fa2feebf221... in / "
               },
               {
                    "created": "2023-08-04T04:53:00.244301537Z",
                    "created_by": "/bin/sh -c #(nop)  CMD [\"/bin/bash\"]",
                    "empty_layer": true
               },
               {
                    "created": "2023-08-16T16:03:18.711312763Z",
                    "created_by": "/bin/sh -c groupadd -r mysql && useradd -r -g mysql mysql"
               },
               {
                    "created": "2023-08-16T16:03:18.795969251Z",
                    "created_by": "/bin/sh -c #(nop)  ENV GOSU_VERSION=1.14",
                    "empty_layer": true
               },
               {
                    "created": "2023-08-16T16:03:18.88320706Z",
                    "created_by": "/bin/sh -c #(nop)  ARG GPG_KEYS=177F4010FE56CA3336300305F1656F...",
                    "empty_layer": true
               },
               {
                    "created": "2023-08-16T16:03:36.895633957Z",
                    "created_by": "|1 GPG_KEYS=177F4010FE56CA3336300305F1656F24C74CD1D8 /bin/sh -c ..."
               },
               {
                    "created": "2023-08-16T16:03:37.474117084Z",
                    "created_by": "|1 GPG_KEYS=177F4010FE56CA3336300305F1656F24C74CD1D8 /bin/sh -c mkdir /docker-entrypoint-initdb.d"
               },
               {
                    "created": "2023-08-16T16:03:37.556078678Z",
                    "created_by": "/bin/sh -c #(nop)  ENV LANG=C.UTF-8",
                    "empty_layer": true
               },
               {
                    "created": "2023-08-22T20:29:33.338401855Z",
                    "created_by": "/bin/sh -c #(nop)  LABEL org.opencontainers.image.authors=MariaDB ...",
                    "empty_layer": true
               },
               {
                    "created": "2023-08-22T20:29:33.428897767Z",
                    "created_by": "/bin/sh -c #(nop)  ARG MARIADB_VERSION=1:11.1.2+maria~ubu2204",
                    "empty_layer": true
               },
               {
                    "created": "2023-08-22T20:29:33.512552629Z",
                    "created_by": "/bin/sh -c #(nop)  ENV MARIADB_VERSION=1:11.1.2+maria~ubu2204",
                    "empty_layer": true
               },
               {
                    "created": "2023-08-22T20:29:33.593360888Z",
                    "created_by": "/bin/sh -c #(nop)  ARG REPOSITORY=...",
                    "empty_layer": true
               },
               {
                    "created": "2023-08-22T20:29:34.109772889Z",
                    "created_by": "|2 GPG_KEYS=177F4010FE56CA3336300305F1656F24C74CD1D8 REPOSITORY=..."
               },
               {
                    "created": "2023-08-22T20:30:12.169566683Z",
                    "created_by": "|2 GPG_KEYS=177F4010FE56CA3336300305F1656F24C74CD1D8 REPOSITORY=..."
               },
               {
                    "created": "2023-08-22T20:30:12.751615194Z",
                    "created_by": "/bin/sh -c #(nop)  VOLUME [/var/lib/mysql]",
                    "empty_layer": true
               },
               {
                    "created": "2023-08-22T20:30:12.846673308Z",
                    "created_by": "/bin/sh -c #(nop) COPY file:1980cab2a8b7fba7431710370aad263c40d..."
               },
               {
                    "created": "2023-08-22T20:30:12.936453274Z",
                    "created_by": "/bin/sh -c #(nop) COPY file:41cd6c305128c82d238b47cc775ecf2262c..."
               },
               {
                    "created": "2023-08-22T20:30:13.022787064Z",
                    "created_by": "/bin/sh -c #(nop)  ENTRYPOINT [\"docker-entrypoint.sh\"]",
                    "empty_layer": true
               },
               {
                    "created": "2023-08-22T20:30:13.11017036Z",
                    "created_by": "/bin/sh -c #(nop)  EXPOSE 3306",
                    "empty_layer": true
               },
               {
                    "created": "2023-08-22T20:30:13.195434751Z",
                    "created_by": "/bin/sh -c #(nop)  CMD [\"mariadbd\"]",
                    "empty_layer": true
               }
          ],
          "NamesHistory": [
               "docker.io/library/mariadb:latest"
          ]
     }
]

Support DTV Linux

Click on each book below to review & buy on Amazon. As an Amazon Associate, I earn from qualifying purchases.

NordVPN ®: Elevate your online privacy and security. Grab our Special Offer to safeguard your data on public Wi-Fi and secure your devices. I may earn a commission on purchases made through this link.