Code Monkey home page Code Monkey logo

aws-ecr-login's Introduction

AWS ECR Login

This script and container aid in loging into AWS EC2 Container Registries (ECR) and updating the .dockercfg files on a host.

Script Usage

./ecr-login.sh [options]
    -r|--region        If not provided, the region will be looked up via AWS metadata (optional on EC2-only).
    -g|--registries    The AWS account IDs to use for the login. Space separated. (Ex: "123456789101, 98765432101")
    -f|--file-location Where the dockercfg should be saved.
    -i|--interval      How often to loop and refresh credentials (optional - default is 21600 - 6 hours).

The script can be run from within a Docker container or stand-alone on either AWS infrastructure or traditional servers. When run in a container, you must mount the host path where you wish the .dockercfg file to be written.

Docker Container

$ docker pull adobeplatform/aws-ecr-login
$ docker run --name aws-ecr-login -v /home/core:/home/core:rw -e "REGION=us-east-1" -e "REGISTRIES=12345678901" -e "FILE_LOCATION=/home/core/.dockercfg" -e "INTERVAL=21600"

Usage on AWS Infrastructure

Running on AWS means that the region can be determined automatically via the AWS metadata service and does not need to be provided via the command line.

Usage on Traditional Servers

Running on traditional servers means that the region must be provided. Failure to provide the region will result in the script hanging as it attempts to contact the (unavailable) AWS metadata service.

$ ./ecr-login.sh --region us-east-1 --registries 12345678901 --file-location /home/core/.dockercfg --interval 21600

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.