Git Product home page Git Product logo

docker-credential-magic / docker-credential-magic Goto Github PK

View Code? Open in Web Editor NEW
60.0 60.0 7.0 600 KB

A magic shim for Docker credential helpers ๐Ÿช„

License: Apache License 2.0

Makefile 2.46% Go 75.03% Shell 14.86% Python 2.26% RobotFramework 5.39%
credentials credentials-helper credentials-storage docker docker-client docker-image-registry docker-images docker-registry magic magician

docker-credential-magic's People

Contributors

imjasonh avatar jdolitsky avatar jonjohnsonjr avatar rothgar avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

docker-credential-magic's Issues

Always push image

In magician, always push the image, skip Docker daemon entirely.

If users want this locally, they can use a -t localhost:5000/....

If no -t flag is provided, attempt to mutate in place (push over existing tag)

Fresh installation throws `init` error while following "Usage" section in the README

I was following the Usage section in the README just after installed the tool. After running the following command, it throws an error.

$ echo "index.docker.io" | docker-credential-magic get

[magic] getting helper executable for domain: Directory '/Users/furkan.turkal/Library/Application Support/magic/etc' does not exist.
Hint: Try running "docker-credential-magic init"

It had better to point this out in the usage instructions, before running the get:

$ docker-credential-magic init

Thanks!

Domain public.aws.ecr fails if not authed to AWS

Discovered in helm/helm#10557

$ cat ~/.docker/config.json 
{
	"credsStore": "magic"
}
$ bin/helm pull oci://public.ecr.aws/aws-controllers-k8s/apigatewayv2-chart --version v0.0.8
Error: error getting credentials - err: exit status 1, out: `credentials not found in native keychain
[magic] exec "docker-credential-ecr-login": exit status 1`

If I remove ecr.aws from the mapping file with

cat "$(docker-credential-magic home)/etc/aws.yml" | grep -v "ecr.aws" > ./aws.yml && mv ./aws.yml "$(docker-credential-magic home)/etc/aws.yml"

then this works:

$ bin/helm pull oci://public.ecr.aws/aws-controllers-k8s/apigatewayv2-chart --version v0.0.8
Pulled: public.ecr.aws/aws-controllers-k8s/apigatewayv2-chart:v0.0.8
Digest: sha256:299d8b520291ade6d136a7529b7fd44338d58b5b8239813aed97e8fd81ca1f00

Running the ECR helper directly:

$ echo "public.ecr.aws" | docker-credential-ecr-login get
credentials not found in native keychain

Important to note, I am not authed to AWS on this machine.

Looks like we introduced ecr.aws in #37 cc @rothgar

Is this a bug in docker-credential-ecr-login then? Should that binary give us an empty token response?

Refactor methods found in cmd/ into pkg/

All code that makes up the docker-credential-magic binary is nested under cmd/docker-credential-magic/. Should clean this up and move some of this into new pkg/ directory.

CI to test against AWS

Similar to GAR/GCR test, make sure ecr-login credential helper works as expected to push/pull from ECR

CI to test against Azure

Similar to GAR/GCR test, make sure acr-linux credential helper works as expected to push/pull from ACR/MCR

Automagically build out ~/.docker/config

Currently it is still required to append domains manually to ~/.docker/config.

Somehow enumerate all domains per helper and append them to this file.

Also, determine the correct user (not always /root/.docker)

In some scenarios, endless loop causes boundless memory consumption

On a mac, with ~/.docker/config.json containing the following:

{
        "auths": {},
        "credsStore": "magic"
}

And using with cosign attach sbom (cosign), and a registry at localhost:5000.

For some reason, many many docker-credential-magic processes are spawned and causes system OOM. Unsure if its a bug here, GGCR (the underlying registry lib), or cosign. Or possibly something wrong with the local registry at port 5000.

Solved with pkill -9 docker-credential-magic

Codenames for credential helpers

Each helper should have a namespace they occupy (for example ecr or amazon for ecr-login). This way, if new helpers come along they will not conflict

Support for other platforms in magician

Currently only Linux x86-64/AMD64 is supported for magician, but should support more. Possibly release separate binaries if we are still embedding the credential helpers.

Handle existing credential file

If an image already has a a ~/.docker/config.json or DOCKER_CONFIG env var set, then this should be set in some env var such as ORIG_DOCKER_CONFIG, and the magic helper should fallback to use this if no domains match

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.