8 Using Skopeo to Inspect and Copy Images

This chapter explains how to use Skopeo to inspect and copy images between container storage types.

Skopeo is an optional utility that you can install in addition to Podman to inspect images in remote registries, and copy images between different types of OCI-compatible container storage. Skopeo doesn't require a running daemon to function.

Note:

You don't need root permissions to run Skopeo commands. If any errors are returned, ensure that you have configured the appropriate proxy server settings, and that you have the necessary access permissions for the remote registries that you're using.

For more information, see the skopeo(1) manual page.

Inspecting an Image in a Remote Registry

Use the skopeo inspect command to inspect information about an image within a registry, such as when it was created, its SHA digest signature, and the environment variables that are set for the image. The information can also be useful for inspecting alternative available tags for a matching image name in the registry. For example, to display information about the oraclelinux:8-slim image, you would type:

skopeo inspect docker://docker.io/library/oraclelinux:8-slim
{
    "Name": "docker.io/library/oraclelinux",
    "Digest": "sha256:410ddd2c0df85b96dc43af11530df8a7adc554e2a61b2645ff3893e53a6e6813",
    "RepoTags": [
        "5.11",
        "5",
        "6-slim",
        "6.10",
        "6.6",
        "6.7",
        "6.8",
        "6.9",
        "6",
        "7-slim",
        "7.0",
        "7.1",
        "7.2",
        "7.3",
        "7.4",
        "7.5",
        "7.6",
        "7.7",
        "7.8",
        "7",
        "8-slim",
        "8.0",
        "8.1",
        "8.2",
        "8"
    ],
    "Created": "2020-06-02T16:25:27.035497362Z",
    "DockerVersion": "18.09.7",
    "Labels": null,
    "Architecture": "amd64",
    "Os": "linux",
    "Layers": [
        "sha256:962e54b445ab56928c06f1d40aebe99a80b10b2bc428260bc931b24cec46e11c"
    ],
    "Env": [
        "PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin"
    ]
}

To review the image's default configuration settings and build history, use the --config option.

skopeo inspect --config docker://docker.io/library/oraclelinux:8-slim
{
    "created": "2020-06-02T16:25:27.035497362Z",
    "author": "Oracle Linux Product Team <ol-ovm-info_ww@oracle.com>",
    "architecture": "amd64",
    "os": "linux",
    "config": {
        "Env": [
            "PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin"
        ],
        "Cmd": [
            "/bin/bash"
        ]
    },
    "rootfs": {
        "type": "layers",
        "diff_ids": [
            "sha256:4beda459d2bfe9960c5537dc4e04b43ffdc8f409897e092df2c0cc2094d82d31"
        ]
    },
    "history": [
        {
            "created": "2018-08-30T21:49:27.028879762Z",
            "created_by": "/bin/sh -c #(nop)  MAINTAINER Oracle Linux Product Team <ol-ovm-in...",
            "author": "Oracle Linux Product Team <ol-ovm-info_ww@oracle.com>",
            "empty_layer": true
        },
        {
            "created": "2020-06-02T16:25:26.6629159Z",
            "created_by": "/bin/sh -c #(nop) ADD file:336b... in / ",
            "author": "Oracle Linux Product Team <ol-ovm-info_ww@oracle.com>"
        },
        {
            "created": "2020-06-02T16:25:27.035497362Z",
            "created_by": "/bin/sh -c #(nop)  CMD [\"/bin/bash\"]",
            "author": "Oracle Linux Product Team <ol-ovm-info_ww@oracle.com>",
            "empty_layer": true
        }
    ]
}

For more information about the skopeo inspect command, see the skopeo-insoect(1) manual page.

Copying an Image Between Container Storage Types

Use the skopeo copy command to copy an image between registries without needing to download it locally first.

skopeo copy docker://docker.io/library/oraclelinux:8-slim docker://example.com/os/oraclelinux:8-slim

If the destination registry requires a signature, provide the required key-id by using the --sign-by parameter.

You can also copy an image to local Podman container storage by adding the containers-storage: prefix to the image name.

skopeo copy docker://docker.io/library/oraclelinux:8-slim containers-storage:oraclelinux:8-slim

To download an image and review its internal content offline, specify a directory with the dir: prefix. For example, to extract the to the oraclelinux:8-slim image to the oraclelinux folder in a home directory, you would type:

skopeo copy docker://docker.io/library/oraclelinux:8-slim dir:/home/$USER/oraclelinux

In the example, the oraclelinux folder contains a manifest.json file and multiple tarballs representing the image that has been copied.

For more information about the prefixes and flags you can use, see the skopeo-copy(1) manual page.

Deleting an Image From Container Storage

Use the skopeo delete command to delete an image from a remote registry or from local container storage:

skopeo delete containers-storage:oraclelinux:8-slim

For more information about the skopeo delete command, see the skopeo-delete(1) manual page.