Skip to content

sparkfabrik/gcp-artifact-registry-docker-proxy

 
 

Repository files navigation

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"]
}

About

A mirror for using GCP Artifact Registry as a cache of Docker Hub

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Languages

  • Go 97.9%
  • Dockerfile 2.1%