{"id":13451608,"url":"https://github.com/google/go-containerregistry","last_synced_at":"2026-03-18T01:13:48.805Z","repository":{"id":37514334,"uuid":"125253663","full_name":"google/go-containerregistry","owner":"google","description":"Go library and CLIs for working with container registries","archived":false,"fork":false,"pushed_at":"2025-05-05T02:52:29.000Z","size":29101,"stargazers_count":3351,"open_issues_count":133,"forks_count":566,"subscribers_count":34,"default_branch":"main","last_synced_at":"2025-05-13T11:06:52.655Z","etag":null,"topics":["container","container-registry","docker","registry"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/google.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":"SECURITY.md","support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2018-03-14T18:02:49.000Z","updated_at":"2025-05-12T11:26:26.000Z","dependencies_parsed_at":"2023-10-03T11:42:52.191Z","dependency_job_id":"303eb5c0-7d86-403e-b50c-ce392779805f","html_url":"https://github.com/google/go-containerregistry","commit_stats":{"total_commits":992,"total_committers":168,"mean_commits":5.904761904761905,"dds":0.654233870967742,"last_synced_commit":"6bce25ecf0297c1aa9072bc665b5cf58d53e1c54"},"previous_names":[],"tags_count":37,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/google%2Fgo-containerregistry","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/google%2Fgo-containerregistry/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/google%2Fgo-containerregistry/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/google%2Fgo-containerregistry/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/google","download_url":"https://codeload.github.com/google/go-containerregistry/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253929364,"owners_count":21985802,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["container","container-registry","docker","registry"],"created_at":"2024-07-31T07:00:56.929Z","updated_at":"2026-02-20T01:06:41.042Z","avatar_url":"https://github.com/google.png","language":"Go","readme":"# go-containerregistry\n\n[![GitHub Actions Build Status](https://github.com/google/go-containerregistry/workflows/Build/badge.svg)](https://github.com/google/go-containerregistry/actions?query=workflow%3ABuild)\n[![GoDoc](https://godoc.org/github.com/google/go-containerregistry?status.svg)](https://godoc.org/github.com/google/go-containerregistry)\n[![Code Coverage](https://codecov.io/gh/google/go-containerregistry/branch/main/graph/badge.svg)](https://codecov.io/gh/google/go-containerregistry)\n\n## Introduction\n\nThis is a golang library for working with container registries.\nIt's largely based on the [Python library of the same name](https://github.com/google/containerregistry).\n\nThe following diagram shows the main types that this library handles.\n![OCI image representation](images/ociimage.jpeg)\n\n## Philosophy\n\nThe overarching design philosophy of this library is to define interfaces that present an immutable\nview of resources (e.g. [`Image`](https://godoc.org/github.com/google/go-containerregistry/pkg/v1#Image),\n[`Layer`](https://godoc.org/github.com/google/go-containerregistry/pkg/v1#Layer),\n[`ImageIndex`](https://godoc.org/github.com/google/go-containerregistry/pkg/v1#ImageIndex)),\nwhich can be backed by a variety of medium (e.g. [registry](./pkg/v1/remote/README.md),\n[tarball](./pkg/v1/tarball/README.md), [daemon](./pkg/v1/daemon/README.md), ...).\n\nTo complement these immutable views, we support functional mutations that produce new immutable views\nof the resulting resource (e.g. [mutate](./pkg/v1/mutate/README.md)).  The end goal is to provide a\nset of versatile primitives that can compose to do extraordinarily powerful things efficiently and easily.\n\nBoth the resource views and mutations may be lazy, eager, memoizing, etc, and most are optimized\nfor common paths based on the tooling we have seen in the wild (e.g. writing new images from disk\nto the registry as a compressed tarball).\n\n\n### Experiments\n\nOver time, we will add new functionality under experimental environment variables listed here.\n\n| Env Var | Value(s) | What is does |\n|---------|----------|--------------|\n| `GGCR_EXPERIMENT_ESTARGZ` | `\"1\"` | ⚠️DEPRECATED⚠️: When enabled this experiment will direct `tarball.LayerFromOpener` to emit [estargz](https://github.com/opencontainers/image-spec/issues/815) compatible layers, which enable them to be lazily loaded by an appropriately configured containerd. |\n\n\n### `v1.Image`\n\n#### Sources\n\n* [`remote.Image`](https://godoc.org/github.com/google/go-containerregistry/pkg/v1/remote#Image)\n* [`tarball.Image`](https://godoc.org/github.com/google/go-containerregistry/pkg/v1/tarball#Image)\n* [`daemon.Image`](https://godoc.org/github.com/google/go-containerregistry/pkg/v1/daemon#Image)\n* [`layout.Image`](https://godoc.org/github.com/google/go-containerregistry/pkg/v1/layout#Path.Image)\n* [`random.Image`](https://godoc.org/github.com/google/go-containerregistry/pkg/v1/random#Image)\n\n#### Sinks\n\n* [`remote.Write`](https://godoc.org/github.com/google/go-containerregistry/pkg/v1/remote#Write)\n* [`tarball.Write`](https://godoc.org/github.com/google/go-containerregistry/pkg/v1/tarball#Write)\n* [`daemon.Write`](https://godoc.org/github.com/google/go-containerregistry/pkg/v1/daemon#Write)\n* [`legacy/tarball.Write`](https://godoc.org/github.com/google/go-containerregistry/pkg/legacy/tarball#Write)\n* [`layout.AppendImage`](https://godoc.org/github.com/google/go-containerregistry/pkg/v1/layout#Path.AppendImage)\n\n### `v1.ImageIndex`\n\n#### Sources\n\n* [`remote.Index`](https://godoc.org/github.com/google/go-containerregistry/pkg/v1/remote#Index)\n* [`random.Index`](https://godoc.org/github.com/google/go-containerregistry/pkg/v1/random#Index)\n* [`layout.ImageIndexFromPath`](https://godoc.org/github.com/google/go-containerregistry/pkg/v1/layout#ImageIndexFromPath)\n\n#### Sinks\n\n* [`remote.WriteIndex`](https://godoc.org/github.com/google/go-containerregistry/pkg/v1/remote#WriteIndex)\n* [`layout.Write`](https://godoc.org/github.com/google/go-containerregistry/pkg/v1/layout#Write)\n\n### `v1.Layer`\n\n#### Sources\n\n* [`remote.Layer`](https://godoc.org/github.com/google/go-containerregistry/pkg/v1/remote#Layer)\n* [`tarball.LayerFromFile`](https://godoc.org/github.com/google/go-containerregistry/pkg/v1/tarball#LayerFromFile)\n* [`random.Layer`](https://godoc.org/github.com/google/go-containerregistry/pkg/v1/random#Layer)\n* [`stream.Layer`](https://godoc.org/github.com/google/go-containerregistry/pkg/v1/stream#Layer)\n\n#### Sinks\n\n* [`remote.WriteLayer`](https://godoc.org/github.com/google/go-containerregistry/pkg/v1/remote#WriteLayer)\n\n## Overview\n\n### `mutate`\n\nThe simplest use for these libraries is to read from one source and write to another.\n\nFor example,\n\n * `crane pull` is `remote.Image -\u003e tarball.Write`,\n * `crane push` is `tarball.Image -\u003e remote.Write`,\n * `crane cp` is `remote.Image -\u003e remote.Write`.\n\nHowever, often you actually want to _change something_ about an image.\nThis is the purpose of the [`mutate`](pkg/v1/mutate) package, which exposes\nsome commonly useful things to change about an image.\n\n### `partial`\n\nIf you're trying to use this library with a different source or sink than it already supports,\nit can be somewhat cumbersome. The `Image` and `Layer` interfaces are pretty wide, with a lot\nof redundant information. This is somewhat by design, because we want to expose this information\nas efficiently as possible where we can, but again it is a pain to implement yourself.\n\nThe purpose of the [`partial`](pkg/v1/partial) package is to make implementing a `v1.Image`\nmuch easier, by filling in all the derived accessors for you if you implement a minimal\nsubset of `v1.Image`.\n\n### `transport`\n\nYou might think our abstractions are bad and you just want to authenticate\nand send requests to a registry.\n\nThis is the purpose of the [`transport`](pkg/v1/remote/transport) and [`authn`](pkg/authn) packages.\n\n## Tools\n\nThis repo hosts some tools built on top of the library.\n\n### `crane`\n\n[`crane`](cmd/crane/README.md) is a tool for interacting with remote images\nand registries.\n\n### `gcrane`\n\n[`gcrane`](cmd/gcrane/README.md) is a GCR-specific variant of `crane` that has\nricher output for the `ls` subcommand and some basic garbage collection support.\n\n### `krane`\n\n[`krane`](cmd/krane/README.md) is a drop-in replacement for `crane` that supports\ncommon Kubernetes-based workload identity mechanisms using [`k8schain`](#k8schain)\nas a fallback to traditional authentication mechanisms.\n\n### `k8schain`\n\n[`k8schain`](pkg/authn/k8schain/README.md) implements the authentication\nsemantics used by kubelets in a way that is easily consumable by this library.\n\n`k8schain` is not a standalone tool, but it is linked here for visibility.\n\n### Emeritus: [`ko`](https://github.com/google/ko)\n\nThis tool was originally developed in this repo but has since been moved to its\nown repo.\n","funding_links":[],"categories":["Go","OCI Image Tools","Containers","Filesystem"],"sub_categories":["Threat modelling"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgoogle%2Fgo-containerregistry","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgoogle%2Fgo-containerregistry","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgoogle%2Fgo-containerregistry/lists"}