Code Monkey home page Code Monkey logo

Comments (4)

matthewdfuller avatar matthewdfuller commented on August 20, 2024

@stevenscg - when you launch an app through Marathon, there is a place you can pass uris as an array of file locations. This ecr-login repo will create the docker config, as well as a tarball in the directory, which you have to pass to the uris for the app. It wasn't originally designed to work with docker directly from the cli (although I don't see why it wouldn't). If you do a docker login where does the file get placed on your system? You may have to modify this script to point at that same location.

Also, which docker version are you on? They changed the format of the configs around 1.9 or so, switching from .dockercfg to .docker/config.json, and I don't think the old docker will recognize this newer format.

from aws-ecr-login.

stevenscg avatar stevenscg commented on August 20, 2024

Hi Matt. Thanks for the info. The script works great and I really like the logging and error handling that you're doing.

I'm actually running it via cron on my docker hosts with a few alterations:

  • Calling "docker login" at the end of the $registries loop
  • Checking for a passed interval == 0 to give me a one-shot run.

Our docker project is greenfield, so we're rolling out 1.13 on RHEL/CentOS.

I was wondering if maybe the $AUTH_TOKEN used by ECR_JSON and ECR_JSON_PLAIN needed to be base64 decoded and split to separate the username and password elements.

My docker login logic looks like this at the moment:

        # Login to the registry
        # get-authorization-token returns a base64 encoded username:password
        # Separate the password
        # http://docs.aws.amazon.com/cli/latest/reference/ecr/get-authorization-token.html
        ECR_PASS=$(echo $AUTH_TOKEN | base64 -d | cut -d: -f2)
        docker login -u AWS -p $ECR_PASS -e none $ENDPOINT

from aws-ecr-login.

stevenscg avatar stevenscg commented on August 20, 2024

I took a fresh look at this again just now. It does appear that the separate docker login commands are not needed.

Building up the "auths" object in ~/.docker/config.json is completely sufficient in my testing and $AUTH_TOKEN does not need to be base64 decoded or split (to answer my own questions).

from aws-ecr-login.

matthewdfuller avatar matthewdfuller commented on August 20, 2024

@stevenscg - great to hear, thanks! Glad you were able to resolve. Let me know if you run into any other issues, or feel free to PR as well if you find any improvements.

from aws-ecr-login.

Related Issues (1)

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.