Work with containers' images
Go to file
tomsweeneyredhat 51a5d96532 Bump to c/image v5.34.0
Bump to c/image v5.34.0 in preparation for Podman v5.4

Signed-off-by: tomsweeneyredhat <tsweeney@redhat.com>
2025-01-30 17:51:14 -05:00
.github [skip-ci] Update actions/checkout action to v4 2023-12-21 04:01:07 +00:00
contrib/cirrus Rename SKOPEO_CI_TAG to SKOPEO_CI_BRANCH 2023-08-07 19:02:33 +02:00
copy Add private.ImageDestination.NoteOriginalOCIConfig 2024-11-28 19:34:59 +01:00
directory Add private.ImageDestination.NoteOriginalOCIConfig 2024-11-28 19:34:59 +01:00
docker ignore ENOENT errors when parsing registries.d files 2025-01-27 18:26:40 +01:00
docs Add @sourceIndex syntax to oci/layout 2025-01-06 11:14:57 +01:00
hack Stop setting GO111MODULE=on 2024-03-26 17:57:52 +01:00
image Add UnparsedInstanceWithReference 2023-10-25 14:52:30 +02:00
internal Add oci/layout.PutBlobFromLocalFile 2025-01-06 11:14:57 +01:00
manifest Fix an incorrect expected MIME type when validating manifests 2024-09-19 18:07:10 +02:00
oci Add a comment justifying lack of unit test coverage 2025-01-06 19:17:24 +01:00
openshift Add private.ImageDestination.NoteOriginalOCIConfig 2024-11-28 19:34:59 +01:00
ostree Introduce private.ImageDestination.CommitWithOptions 2024-11-04 17:22:49 +01:00
pkg ignore ENOENT errors when parsing .crt files 2025-01-27 18:40:55 +01:00
sif Stop using deprecated digest.Digest.Hex 2024-05-14 11:18:00 +02:00
signature Move JSONFormatToInvalidSignatureError to an unconditionally-included file 2025-01-06 20:45:30 +01:00
storage Enforce that DiffID of a layer matches the config 2025-01-21 22:13:32 +01:00
tarball Use %w for error wrapping 2024-08-19 13:30:40 -07:00
transports Quote various strings coming from untrusted sources 2024-05-09 19:22:23 +02:00
types registry: remove ping v1 2024-10-02 15:13:10 +02:00
version Bump to c/image v5.34.0 2025-01-30 17:51:14 -05:00
.cirrus.yml Update dependency containers/automation_images to v20250107 2025-01-08 13:32:02 +00:00
.codespellrc Simplify codespellrc, fix remaining typos 2024-08-02 13:37:53 -07:00
.gitignore Issue #475 Add flag for image compress layer for oci destination 2018-07-12 17:50:17 +05:30
.golangci.yml ci: add errorlint linter 2024-08-19 13:32:12 -07:00
.pullapprove.yml *: add pullapprove 2016-06-27 16:34:59 +02:00
CODE-OF-CONDUCT.md Fix docs links due to branch rename 2021-06-10 11:23:41 -04:00
CONTRIBUTING.md one commit 2021-04-06 21:50:49 -04:00
LICENSE Move to Apache 2 license 2016-06-24 11:35:34 -07:00
MAINTAINERS add @vrothberg to the list of MAINTAINERS 2019-01-11 16:33:51 +01:00
Makefile Update dependency golangci/golangci-lint to v1.63.4 2025-01-03 22:12:56 +00:00
README.md Fix GoDoc link at the top of the README file 2024-04-27 01:39:19 +05:30
SECURITY.md Fix docs links due to branch rename 2021-06-10 11:23:41 -04:00
default-policy.json Moving policy.json and default.yaml from containers/skopeo 2023-12-10 04:46:35 +05:30
default.yaml Moving policy.json and default.yaml from containers/skopeo 2023-12-10 04:46:35 +05:30
doc.go Reformat with Go 1.19's gofmt 2022-08-10 20:38:52 +02:00
go.mod Bump c/storage to v1.57.1 2025-01-30 17:50:44 -05:00
go.sum Bump c/storage to v1.57.1 2025-01-30 17:50:44 -05:00
registries.conf Use consistent example domains 2023-08-03 00:39:53 +02:00

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 # potentially also ostree-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_ostree: Import ostree: transport in github.com/containers/image/transports/alltransports. This builds the library requiring the libostree development libraries. Otherwise a stub which reports that the transport is not supported gets used. The github.com/containers/image/ostree package is completely disabled and impossible to import when this build tag is not in use.
  • 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