GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - ingwonsong/docker-credential-magic-proxy: HTTP Gateway to access platform specific registries by using Workload Identity

BranchesTags
Open more actions menu

Latest commit

 

History

7 Commits
7 Commits

Folders and files

NameName
Last commit message
Last commit date
.ko/debug
.ko/debug
 
 
cmd/proxy
cmd/proxy
 
 
pkg
pkg
 
 
.gitignore
.gitignore
 
 
CONTRIBUTING.md
CONTRIBUTING.md
 
 
LICENSE
LICENSE
 
 
Makefile
Makefile
 
 
README.md
README.md
 
 
go.mod
go.mod
 
 
go.sum
go.sum
 
 

Repository files navigation

docker-credential-magic-proxy

Overview

docker-credential-magic-proxy is a HTTP proxy injecting the authentication header for accessing private docker registries. The credentials in $HOME/.docker/config.json or $DOCKER_CONFIG/config.json will be used for generating the authentication header. In addition, the docker credential helpers of GCR, ECR, and ACR are included to support the repositories.

Please note that the name of this project is inspired from https://github.com/docker-credential-magic/docker-credential-magic.

Build

HUB=${YOUR_DOCKER_REPO} make publish

Let's run

Here, we use GKE for demo purpose. The other platform (AWS or Azure) can be used with the similar settings.

Preparation

If GKE is used, the workload identity need to be enabled.

gcloud iam service-accounts add-iam-policy-binding [email protected] \
    --role roles/iam.workloadIdentityUser \
    --member "serviceAccount:PROJECT-NAME.svc.id.goog[magic/magic-service-account]"

Deploy Proxy

kubectl create namespace magic
cat <<EOF | kubectl apply -n magic -f -
apiVersion: v1
kind: ServiceAccount
metadata:
  name: magic-service-account
  # In GCP, to access the private registry using the workload identity, service account need to be set up.
  # e.g.)
  # annotations:
  #   "iam.gke.io/gcp-service-account": "[email protected]"
---
apiVersion: v1
kind: Pod
metadata:
  name: docker-credential-magic-proxy
  labels:
    app: docker-credential-magic-proxy
spec:
  serviceAccountName: magic-service-account
  containers:
  - name: proxy
    image: ghcr.io/ingwonsong/docker-credential-magic-proxy/proxy:latest
    args:
    - "--proxy-port"
    - "5000"
EOF

Run Crane without local credentials

# Port forwarding to local address.
kubectl port-forward -n magic docker-credential-magic-proxy 5000:5000
# DOCKER_CONFIG is given here to ignore ~/.docker/config.json
DOCKER_CONFIG=/tmp crane ls localhost:5000/forwardto/gcr.io/YOUR-PRIVATE-REPO

About

HTTP Gateway to access platform specific registries by using Workload Identity

Topics

containercontainer-registrycontainer-registry-proxycredentials-helperdockerdocker-image-registrydocker-imagesdocker-registryhttp-proxyproxy

Resources

Readme
Apache-2.0 license

Contributing

Contributing
Activity

Stars

1 star

Watchers

1 watching

Forks

2 forks
Report repository

Releases

Packages

Used by

Contributors

Languages

You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.