cd-ci-glue
Functions
Amazon Web Services

Functions

 awsecr_login ()
 Login to Amazon Elastic Container Registry. (ECR) More...
 
 awsecr_push_image (image)
 Push a locally built docker image to Amazon ECR. More...
 

Detailed Description

Function Documentation

◆ awsecr_login()

awsecr_login ( )

Login to Amazon Elastic Container Registry. (ECR)

Environment variables
AWS_ACCESS_KEY_ID Specifies an AWS access key associated with an IAM user or role.
AWS_SECRET_ACCESS_KEY Specifies the secret key associated with the access key.
AWS_DEFAULT_REGION Specifies the AWS Region to send the request to.

Outputs the full AWS ECR repository URL to stdout. (e.g. https://<aws_account_id>.dkr.ecr.<region>.amazonaws.com)

Example
$ export REGISTRY_URL="$(awsecr_login)" || exit 1
$ docker run "${REGISTRY_URL}/madworx/robotframework-kicadlibrary"

◆ awsecr_push_image()

awsecr_push_image ( image  )

Push a locally built docker image to Amazon ECR.

Parameters
imageImage identifier to push (e.g. madworx/docshell:3.14).
Environment variables
AWS_ACCESS_KEY_ID Specifies an AWS access key associated with an IAM user or role.
AWS_SECRET_ACCESS_KEY Specifies the secret key associated with the access key.
AWS_DEFAULT_REGION Specifies the AWS Region to send the request to.

This function will as a side-effect tag the local image with the ECR remote registry URL prefix. Will output the complete path to the pushed image onto stdout (e.g. 863710587213.dkr.ecr.eu-north-1.amazonaws.com/madworx/docker-netbsd:8.0).

(You do not need to call awsecr_login() before calling this function.)
Example
$ docker build -t madworx/sample:1.0.1 .
$ FULL_PATH="$(awsecr_push_image madworx/sample:1.0.1)" || exit 1
$ docker run "${FULL_PATH}"