Skip to content

Latest commit

 

History

History
29 lines (20 loc) · 1.14 KB

File metadata and controls

29 lines (20 loc) · 1.14 KB

GCP Artifact Registry Docker Proxy

When trying to use a GCP Artifact Registry repository as a cache for Docker Hub, Docker presents a handful of challenges:

  1. No authentication is provided.
  2. The request paths for library images (say hello-world) don't match what GCP requires.

This proxy handles both of those by using GCP Application Default Credentials for injecting authentication and rewriting matching paths.

You can either pass the arguments via the command line as flags:

gcp-artifact-registry-docker-proxy --listen localhost:1234 --registry https://us-docker.pkg.dv/example-project/example-repo

Or via environment variables:

PROXY_LISTEN=localhost:1234 PROXY_REGISTRY=https://us-docker.pkg.dv/example-project/example-repo gcp-artifact-registry-docker-proxy

To configure docker daemon with Gcp Artifact Registry Docker Proxy add registry-mirror to /etc/docker/daemon.json (on linux):

{
  "registry-mirrors": ["http://localhost:1234/<YOUR GCP PROJECT NAME>/<ARTIFACT REGISTRY NAME>/"],
  "insecure-registries": ["localhost:1234"]
}