MCPcopy Index your code
hub / github.com/containers/image

github.com/containers/image @v5.36.2

Chat with this repo
repository ↗ · DeepWiki ↗ · release v5.36.2 ↗ · + Follow
2,984 symbols 11,546 edges 345 files 1,819 documented · 61% 12 cross-repo links
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

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: Don’t 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: Don’t 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.

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

Extension points exported contracts — how you extend this code

ImageTransport (Interface)
ImageTransport is a top-level namespace for ways to store/load an image. It should generally correspond to ImageSource/I [10 …
types/types.go
BlobChunkAccessor (Interface)
BlobChunkAccessor allows fetching discontiguous chunks of a blob. [6 implementers]
internal/private/private.go
Named (Interface)
Named is an object with a full name [13 implementers]
docker/reference/reference.go
PolicyReferenceMatch (Interface)
PolicyReferenceMatch specifies a set of image identities accepted in PolicyRequirement. The type is public, but its impl [6 …
signature/policy_eval.go
SignerImplementation (Interface)
SignerImplementation is an object, possibly carrying state, that can be used by copy.Image to sign one or more container [4 …
internal/signer/signer.go
BlobInfoCache2 (Interface)
BlobInfoCache2 extends BlobInfoCache by adding the ability to track information about what kind of compression was appli [4 …
internal/blobinfocache/types.go
Signature (Interface)
Signature is an image signature of some kind. [3 implementers]
internal/signature/signature.go
Manifest (Interface)
Manifest is an interface for parsing, modifying image manifests in isolation. Callers can either use this abstract inter [3 …
manifest/manifest.go

Core symbols most depended-on inside this repo

String
called by 295
docker/reference/reference.go
Close
called by 182
types/types.go
Error
called by 163
signature/internal/json.go
Name
called by 157
types/types.go
Digest
called by 127
docker/reference/reference.go
ParseNormalizedNamed
called by 88
docker/reference/normalize.go
PRSigstoreSignedWithSignedIdentity
called by 82
signature/policy_config_sigstore.go
Error
called by 79
docker/errors.go

Shape

Function 1,408
Method 1,112
Struct 366
TypeAlias 47
Interface 40
FuncType 11

Languages

Go100%

Modules by API surface

types/types.go79 symbols
openshift/openshift-copies.go67 symbols
signature/policy_config_test.go55 symbols
signature/policy_config.go54 symbols
docker/reference/reference.go49 symbols
pkg/sysregistriesv2/system_registries_v2.go44 symbols
internal/image/docker_schema2_test.go42 symbols
docker/docker_client.go39 symbols
storage/storage_dest.go38 symbols
signature/policy_config_sigstore.go35 symbols
pkg/docker/config/config.go32 symbols
docker/docker_image_src.go32 symbols

Datastores touched

(mysql)Database · 1 repos

For agents

$ claude mcp add image \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact