Work with containers' images
Go to file
Miloslav Trmač 39410b5461 Queue a partially-pulled layer for commit immediately after staging it
Don't block all other layer commits until all layers are downloaded
/ staged.

Signed-off-by: Miloslav Trmač <mitr@redhat.com>
2025-06-02 19:34:36 +02:00
.github
contrib/cirrus
copy Queue a partially-pulled layer for commit immediately after staging it 2025-06-02 19:34:36 +02:00
directory
docker Only upload sigstore signatures to the sigstore tag schema 2025-06-02 17:32:40 +02:00
docs INCOMPATIBLE: Remove the implementation of the ostree transport 2025-05-31 01:28:07 +02:00
hack
image
internal Queue a partially-pulled layer for commit immediately after staging it 2025-06-02 19:34:36 +02:00
manifest
oci
openshift
pkg
sif
signature
storage Queue a partially-pulled layer for commit immediately after staging it 2025-06-02 19:34:36 +02:00
tarball
transports INCOMPATIBLE: Remove the implementation of the ostree transport 2025-05-31 01:28:07 +02:00
types INCOMPATIBLE: Remove the implementation of the ostree transport 2025-05-31 01:28:07 +02:00
version
.cirrus.yml
.codespellrc
.gitignore
.golangci.yml
.pullapprove.yml
CODE-OF-CONDUCT.md
CONTRIBUTING.md
LICENSE
MAINTAINERS
Makefile
README.md INCOMPATIBLE: Remove the implementation of the ostree transport 2025-05-31 01:28:07 +02:00
SECURITY.md
default-policy.json
default.yaml
doc.go
go.mod fix(deps): update github.com/containers/storage digest to 78f4258 2025-06-02 16:58:51 +00:00
go.sum fix(deps): update github.com/containers/storage digest to 78f4258 2025-06-02 16:58:51 +00:00
registries.conf

README.md

Go Reference Build Status

image is a set of Go libraries aimed at working in various way with containers' images and container image registries.

The containers/image library allows application to pull and push images from container image registries, like the docker.io and quay.io registries. It also implements "simple image signing".

The containers/image library also allows you to inspect a repository on a container registry without pulling down the image. This means it 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 library, in contrast to docker inspect, helps you gather useful information about a repository or a tag without requiring you to run docker pull.

The containers/image library also allows you to translate from one image format to another, for example docker container images to OCI images. It also allows you to copy container images between various registries, possibly converting them as necessary, and to sign and verify images.

Command-line usage

The containers/image project is only a library with no user interface; you can either incorporate it into your Go programs, or use the skopeo tool:

The skopeo tool uses the containers/image library and takes advantage of many of its features, e.g. skopeo copy exposes the containers/image/copy.Image functionality.

Dependencies

This library ships as a Go module.

Building

If you want to see what the library can do, or an example of how it is called, consider starting with the skopeo tool instead.

To integrate this library into your project, include it as a Go module, put it into $GOPATH or use your preferred vendoring tool to include a copy in your project. Ensure that the dependencies documented in go.mod are also available (using those exact versions or different versions of your choosing).

This library also depends on some C libraries. Either install them:

Fedora$ dnf install gpgme-devel libassuan-devel
macOS$ brew install gpgme

or use the build tags described below to avoid the dependencies (e.g. using go build -tags …)

Supported build tags

  • containers_image_docker_daemon_stub: Dont import the docker-daemon: transport in github.com/containers/image/transports/alltransports, to decrease the amount of required dependencies. Use a stub which reports that the transport is not supported instead.
  • containers_image_openpgp: Use a Golang-only OpenPGP implementation for signature verification instead of the default cgo/gpgme-based implementation; the primary downside is that creating new signatures with the Golang-only implementation is not supported.
  • containers_image_storage_stub: Dont import the containers-storage: transport in github.com/containers/image/transports/alltransports, to decrease the amount of required dependencies. Use a stub which reports that the transport is not supported instead.
  • containers_image_fulcio_stub: Don't import sigstore/fulcio code, all fulcio operations will return an error code
  • containers_image_rekor_stub: Don't import sigstore/reckor code, all rekor operations will return an error code

Contributing

Information about contributing to this project.

When developing this library, please use make (or make … BUILDTAGS=…) to take advantage of the tests and validation.

License

Apache License 2.0

SPDX-License-Identifier: Apache-2.0

Contact