• Stars
    star
    7,300
  • Rank 5,012 (Top 0.2 %)
  • Language
    Go
  • License
    Apache License 2.0
  • Created about 8 years ago
  • Updated 9 days ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Work with remote images registries - retrieving information, images, signing content

Skopeo


skopeo is a command line utility that performs various operations on container images and image repositories.

skopeo does not require the user to be running as root to do most of its operations.

skopeo does not require a daemon to be running to perform its operations.

skopeo can work with OCI images as well as the original Docker v2 images.

Skopeo works with API V2 container image registries such as docker.io and quay.io registries, private registries, local directories and local OCI-layout directories. Skopeo can perform operations which consist of:

  • Copying an image from and to various storage mechanisms. For example you can copy images from one registry to another, without requiring privilege.
  • Inspecting a remote image showing its properties including its layers, without requiring you to pull the image to the host.
  • Deleting an image from an image repository.
  • Syncing an external image repository to an internal registry for air-gapped deployments.
  • When required by the repository, skopeo can pass the appropriate credentials and certificates for authentication.

Skopeo operates on the following image and repository types:

  • containers-storage:docker-reference An image located in a local containers/storage image store. Both the location and image store are specified in /etc/containers/storage.conf. (This is the backend for Podman, CRI-O, Buildah and friends)

  • dir:path An existing local directory path storing the manifest, layer tarballs and signatures as individual files. This is a non-standardized format, primarily useful for debugging or noninvasive container inspection.

  • docker://docker-reference An image in a registry implementing the "Docker Registry HTTP API V2". By default, uses the authorization state in $XDG_RUNTIME_DIR/containers/auth.json, which is set using skopeo login.

  • docker-archive:path[:docker-reference] An image is stored in a docker save-formatted file. docker-reference is only used when creating such a file, and it must not contain a digest.

  • docker-daemon:docker-reference An image docker-reference stored in the docker daemon internal storage. docker-reference must contain either a tag or a digest. Alternatively, when reading images, the format can also be docker-daemon:algo:digest (an image ID).

  • oci:path:tag An image tag in a directory compliant with "Open Container Image Layout Specification" at path.

Obtaining skopeo

For a detailed description how to install or build skopeo, see install.md.

Inspecting a repository

skopeo is able to inspect a repository on a container registry and fetch images layers. The inspect command fetches the repository's manifest and it is able to show you a docker inspect-like json output about a whole repository or a tag. This tool, in contrast to docker inspect, helps you gather useful information about a repository or a tag before pulling it (using disk space). The inspect command can show you which tags are available for the given repository, the labels the image has, the creation date and operating system of the image and more.

Examples:

Show properties of fedora:latest

$ skopeo inspect docker://registry.fedoraproject.org/fedora:latest
{
    "Name": "registry.fedoraproject.org/fedora",
    "Digest": "sha256:0f65bee641e821f8118acafb44c2f8fe30c2fc6b9a2b3729c0660376391aa117",
    "RepoTags": [
        "34-aarch64",
        "34",
        "latest",
        ...
    ],
    "Created": "2022-11-24T13:54:18Z",
    "DockerVersion": "1.10.1",
    "Labels": {
        "license": "MIT",
        "name": "fedora",
        "vendor": "Fedora Project",
        "version": "37"
    },
    "Architecture": "amd64",
    "Os": "linux",
    "Layers": [
        "sha256:2a0fc6bf62e155737f0ace6142ee686f3c471c1aab4241dc3128904db46288f0"
    ],
    "LayersData": [
        {
            "MIMEType": "application/vnd.docker.image.rootfs.diff.tar.gzip",
            "Digest": "sha256:2a0fc6bf62e155737f0ace6142ee686f3c471c1aab4241dc3128904db46288f0",
            "Size": 71355009,
            "Annotations": null
        }
    ],
    "Env": [
        "DISTTAG=f37container",
        "FGC=f37",
        "container=oci"
    ]
}

Show container configuration from fedora:latest

$ skopeo inspect --config docker://registry.fedoraproject.org/fedora:latest  | jq
{
  "created": "2020-04-29T06:48:16Z",
  "architecture": "amd64",
  "os": "linux",
  "config": {
    "Env": [
      "DISTTAG=f32container",
      "FGC=f32",
      "container=oci"
    ],
    "Cmd": [
      "/bin/bash"
    ],
    "Labels": {
      "license": "MIT",
      "name": "fedora",
      "vendor": "Fedora Project",
      "version": "32"
    }
  },
  "rootfs": {
    "type": "layers",
    "diff_ids": [
      "sha256:a4c0fa2b217d3fd63d51e55a6fd59432e543d499c0df2b1acd48fbe424f2ddd1"
    ]
  },
  "history": [
    {
      "created": "2020-04-29T06:48:16Z",
      "comment": "Created by Image Factory"
    }
  ]
}

Show unverified image's digest

$ skopeo inspect docker://registry.fedoraproject.org/fedora:latest | jq '.Digest'
"sha256:655721ff613ee766a4126cb5e0d5ae81598e1b0c3bcf7017c36c4d72cb092fe9"

Copying images

skopeo can copy container images between various storage mechanisms, including:

  • Container registries

    • The Quay, Docker Hub, OpenShift, GCR, Artifactory ...
  • Container Storage backends

  • Local directories

  • Local OCI-layout directories

$ skopeo copy docker://quay.io/buildah/stable docker://registry.internal.company.com/buildah
$ skopeo copy oci:busybox_ocilayout:latest dir:existingemptydirectory

Deleting images

$ skopeo delete docker://localhost:5000/imagename:latest

Syncing registries

$ skopeo sync --src docker --dest dir registry.example.com/busybox /media/usb

Authenticating to a registry

Private registries with authentication

skopeo uses credentials from the --creds (for skopeo inspect|delete) or --src-creds|--dest-creds (for skopeo copy) flags, if set; otherwise it uses configuration set by skopeo login, podman login, buildah login, or docker login.

$ skopeo login --username USER myregistrydomain.com:5000
Password:
$ skopeo inspect docker://myregistrydomain.com:5000/busybox
{"Tag":"latest","Digest":"sha256:473bb2189d7b913ed7187a33d11e743fdc2f88931122a44d91a301b64419f092","RepoTags":["latest"],"Comment":"","Created":"2016-01-15T18:06:41.282540103Z","ContainerConfig":{"Hostname":"aded96b43f48","Domainname":"","User":"","AttachStdin":false,"AttachStdout":false,"AttachStderr":false,"Tty":false,"OpenStdin":false,"StdinOnce":false,"Env":null,"Cmd":["/bin/sh","-c","#(nop) CMD [\"sh\"]"],"Image":"9e77fef7a1c9f989988c06620dabc4020c607885b959a2cbd7c2283c91da3e33","Volumes":null,"WorkingDir":"","Entrypoint":null,"OnBuild":null,"Labels":null},"DockerVersion":"1.8.3","Author":"","Config":{"Hostname":"aded96b43f48","Domainname":"","User":"","AttachStdin":false,"AttachStdout":false,"AttachStderr":false,"Tty":false,"OpenStdin":false,"StdinOnce":false,"Env":null,"Cmd":["sh"],"Image":"9e77fef7a1c9f989988c06620dabc4020c607885b959a2cbd7c2283c91da3e33","Volumes":null,"WorkingDir":"","Entrypoint":null,"OnBuild":null,"Labels":null},"Architecture":"amd64","Os":"linux"}
$ skopeo logout myregistrydomain.com:5000

Using --creds directly

$ skopeo inspect --creds=testuser:testpassword docker://myregistrydomain.com:5000/busybox
{"Tag":"latest","Digest":"sha256:473bb2189d7b913ed7187a33d11e743fdc2f88931122a44d91a301b64419f092","RepoTags":["latest"],"Comment":"","Created":"2016-01-15T18:06:41.282540103Z","ContainerConfig":{"Hostname":"aded96b43f48","Domainname":"","User":"","AttachStdin":false,"AttachStdout":false,"AttachStderr":false,"Tty":false,"OpenStdin":false,"StdinOnce":false,"Env":null,"Cmd":["/bin/sh","-c","#(nop) CMD [\"sh\"]"],"Image":"9e77fef7a1c9f989988c06620dabc4020c607885b959a2cbd7c2283c91da3e33","Volumes":null,"WorkingDir":"","Entrypoint":null,"OnBuild":null,"Labels":null},"DockerVersion":"1.8.3","Author":"","Config":{"Hostname":"aded96b43f48","Domainname":"","User":"","AttachStdin":false,"AttachStdout":false,"AttachStderr":false,"Tty":false,"OpenStdin":false,"StdinOnce":false,"Env":null,"Cmd":["sh"],"Image":"9e77fef7a1c9f989988c06620dabc4020c607885b959a2cbd7c2283c91da3e33","Volumes":null,"WorkingDir":"","Entrypoint":null,"OnBuild":null,"Labels":null},"Architecture":"amd64","Os":"linux"}
$ skopeo copy --src-creds=testuser:testpassword docker://myregistrydomain.com:5000/private oci:local_oci_image

Contributing

Please read the contribution guide if you want to collaborate in the project.

Commands

Command Description
skopeo-copy(1) Copy an image (manifest, filesystem layers, signatures) from one location to another.
skopeo-delete(1) Mark the image-name for later deletion by the registry's garbage collector.
skopeo-generate-sigstore-key(1) Generate a sigstore public/private key pair.
skopeo-inspect(1) Return low-level information about image-name in a registry.
skopeo-list-tags(1) Return a list of tags for the transport-specific image repository.
skopeo-login(1) Login to a container registry.
skopeo-logout(1) Logout of a container registry.
skopeo-manifest-digest(1) Compute a manifest digest for a manifest-file and write it to standard output.
skopeo-standalone-sign(1) Debugging tool - Publish and sign an image in one step.
skopeo-standalone-verify(1) Verify an image signature.
skopeo-sync(1) Synchronize images between registry repositories and local directories.

License

skopeo is licensed under the Apache License, Version 2.0. See LICENSE for the full license text.

More Repositories

1

podman

Podman: A tool for managing OCI containers and pods.
Go
21,565
star
2

buildah

A tool that facilitates building OCI images.
Go
6,972
star
3

youki

A container runtime written in Rust
Rust
5,766
star
4

podman-compose

a script to run docker-compose.yml using podman
Python
4,567
star
5

podman-desktop

Podman Desktop - A graphical tool for developing on containers and Kubernetes
TypeScript
4,102
star
6

bubblewrap

Low-level unprivileged sandboxing tool used by Flatpak and similar projects
C
3,601
star
7

crun

A fast and lightweight fully featured OCI runtime and C library for running containers
C
2,759
star
8

toolbox

Tool for interactive command line environments on Linux
Shell
2,263
star
9

krunvm

Create microVMs from OCI images
Rust
1,315
star
10

image

Work with containers' images
Go
816
star
11

libkrun

A dynamic library providing Virtualization-based process isolation capabilities
Rust
655
star
12

storage

Container Storage Library
Go
522
star
13

podman-tui

Podman Terminal UI
Go
494
star
14

fuse-overlayfs

FUSE implementation for overlayfs
C
476
star
15

netavark

Container network stack
Rust
457
star
16

udica

This repository contains a tool for generating SELinux security profiles for containers
Python
425
star
17

conmon

An OCI container runtime monitor.
C
393
star
18

composefs

a file system for mounting container images
C
368
star
19

build

another build tool for container images (archived, see https://github.com/rkt/rkt/issues/4024)
Go
341
star
20

quadlet

C
330
star
21

oci-seccomp-bpf-hook

OCI hook to trace syscalls and generate a seccomp profile
Go
280
star
22

podman.io_old

Repository for podman.io website using GitHub Pages.
CSS
259
star
23

bootc

Boot and upgrade via container images
Rust
250
star
24

ansible-podman-collections

Repository for Ansible content that can include playbooks, roles, modules, and plugins for use with the Podman tool
Python
233
star
25

container-selinux

SELinux policy files for Container Runtimes
Roff
227
star
26

podman-py

Python bindings for Podman's RESTful API
Python
215
star
27

gvisor-tap-vsock

A new network stack based on gVisor
Go
212
star
28

dnsname

name resolution for containers
Go
178
star
29

oci-spec-rs

OCI Runtime, Image and Distribution Spec in Rust
Rust
173
star
30

common

Location for shared common files in github.com/containers repos.
Go
161
star
31

conmon-rs

An OCI container runtime monitor written in Rust
Rust
157
star
32

aardvark-dns

Authoritative dns server for A/AAAA container records. Forwards other request to host's /etc/resolv.conf
Rust
151
star
33

docker-lvm-plugin

Docker volume plugin for LVM volumes
Go
148
star
34

virtcontainers

A Go package for building hardware virtualized container runtimes
Go
140
star
35

containrs

General purpose container library
Rust
122
star
36

ocicrypt

Encryption libraries for Encrypted OCI Container images
Go
121
star
37

fetchit

FetchIt is used to manage the life cycle and configuration of Podman containers
Go
109
star
38

prometheus-podman-exporter

Prometheus exporter for podman environments exposing containers, pods, images, volumes and networks information.
Go
105
star
39

bluechi

Bluechi is a systemd service controller intended for multi-node environments with a predefined number of nodes and with a focus on highly regulated ecosystems such as those requiring functional safety.
C
96
star
40

crun-vm

An OCI Runtime that enables Podman, Docker, and Kubernetes to run VM images.
Rust
78
star
41

Demos

Repository is a location of user demos for technologies listed on github.com/containers
Shell
77
star
42

shortnames

Shortnames project is collecting registry alias names for shortnames to fully specified container image names.
Python
66
star
43

libkrunfw

A dynamic library bundling the guest payload consumed by libkrun
C
59
star
44

psgo

A ps(1) AIX-format compatible golang library
Go
56
star
45

python-podman

Python bindings and code examples for using Varlink access to Podman Service
Python
50
star
46

libocispec

a C library for accessing OCI runtime and image spec files
Python
47
star
47

tar-diff

Go
46
star
48

nri-plugins

A collection of community maintained NRI plugins
Go
44
star
49

selinuxd

A daemon that manages SELinux policies on a filesystem
Go
37
star
50

podman-desktop-swift

Swift
34
star
51

podman.io

The new podman.io design project
TypeScript
33
star
52

podman-security-bench

Shell
33
star
53

initoverlayfs

C
32
star
54

nydus-storage-plugin

A storage plugin that provided CRI-O/Podman with the ability to lazy mount nydus images.
Go
30
star
55

buildah.io

Repository for the buildah.io web site using GitHub Pages.
HTML
27
star
56

BuildSourceImage

Tool to build a source image based on an existing OCI image
Shell
26
star
57

ansible-podman

Ansible podman is a package to allow ansible playbooks to manage podman containers
Python
26
star
58

oci-fetch

Simple command line tool for fetching the Open Container Initiative image format over various transports.
Go
23
star
59

podman-wsl-fedora

Root FS image of Fedora for Podman Machine on Windows
22
star
60

containertoolbx.org

Website for the Toolbx project
CSS
20
star
61

appstore

Example directory of Kubernetes YAML and Quadlets tested with Podman
Python
18
star
62

automation_images

Shell
17
star
63

containers-image-proxy-rs

containers-image-proxy-rs
Rust
17
star
64

podman-machine-qemu

Qemu build for macOS used by the self-contained `podman machine` installer
Shell
16
star
65

libhvee

Special purposed library for Windows HyperV control
Go
15
star
66

qm

QM is a containerized environment for running Functional Safety qm (Quality Management) software
Shell
14
star
67

oci-umount

C
13
star
68

docs

Repository for all documentation written about tools hosted at github.com/containers
Shell
12
star
69

netavark-dhcp-proxy-deprecated

DHCP proxy for Netavark
Rust
12
star
70

automation

Automation scripts and configurations common across the containers org. repositories
Shell
12
star
71

podman-desktop-extension-bootc

Support for bootable OS containers (bootc) and generating disk images
TypeScript
9
star
72

podhawk

Python
9
star
73

podman-machine-cni

Go
6
star
74

podman-desktop-catalog

Catalog of extensions of Podman Desktop
6
star
75

validator

C
6
star
76

arty

Arty is a tool for managing OCI Artifacts on OCI Registries.
6
star
77

automation_sandbox

Test-repository for experimenting with in-repo automation tools/settings.
Shell
4
star
78

kubensmnt

Shell
4
star
79

podman-desktop-e2e

Podman desktop e2e tests
Go
3
star
80

.github

The README for the containers organization
3
star
81

fetchit-desktop-extension

TypeScript
3
star
82

podman-desktop-extension-minikube

TypeScript
2
star
83

release-keys

2
star
84

podman-wsl-fedora-arm

Fedora ARM distribution for Podman Machine on WSL
2
star
85

ContainerPlumbing

Container Plumbing Conference information.
2
star
86

bootable

Ruby
2
star
87

nri-plugins-operator

Makefile
2
star
88

luksy

offline encryption/decryption using LUKS formats
Go
2
star
89

PodmanHello

Podman Hello Image Repository
Dockerfile
1
star
90

containers.github.io

HTML
1
star
91

winquit

golang module that supports graceful shutdown of Windows applications
Go
1
star
92

podman-installer

1
star
93

ai-lab-recipes

ai-studio-recipes
1
star