ecr-get-login

command module
v1.0.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 17, 2017 License: BSD-3-Clause Imports: 9 Imported by: 0

README

ecr-get-login

Build Status

This is a stand-alone tool for logging in Docker to an ECS Registry. The motivation for this over the AWS CLI tool is to avoid the need to install Python and the various dependencies of the AWS CLI tool.

Usage

The basic usage involves passing an account ID as an argument:

eval $(ecr-get-login 1234567890)

By default the region will be retrieved from the AWS_REGION environment variable. You may alternatively pass the region via the -region flag:

eval $(ecr-get-login -region=us-east-1 1234567890)

Example Unit File

The following unit file can be used to start ECR prior to a unit which requires ECR access:

[Unit]
Description=Log in to ECR
After=network.target
[Service]
Type=oneshot
User=core
EnvironmentFile=/etc/environment.ecr
ExecStart=/usr/bin/sh -c "eval $(/opt/bin/ecr-get-login -region=${ECR_REGION} ${ECR_ACCOUNT})"

The contents of /etc/environment.ecr should container the referenced variables:

ECR_REGION=us-east-1
ECR_ACCOUNT=1234567890

The above unit file is specific to CoreOS and so runs as the core user. This should be changed to a user more appopriate for your OS.

Documentation

The Go Gopher

There is no documentation for this package.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL