Amazon Elastic Container Registry (ECR)
You need one repository for each application that you will deploy, with the same name as the application. The following steps describe how to create a repository and publish an image to it:
-
Create a private repository from Amazon Container Services (ECR) console
. Select the region you are working in. For example:
803424716218.dkr.ecr.eu-central-1.amazonaws.com/shopping-cart-service
-
Authenticate Docker using the first part of the URI, for example:
aws ecr get-login-password --region eu-central-1 | docker login \ --username AWS \ --password-stdin 803424716218.dkr.ecr.eu-central-1.amazonaws.com
-
Build the Docker image and publish to ECR with the following (The
build.sbt and project/plugins.sbt
pom.xml
contains build plugin settings for building a Docker image.):- Java
-
mvn -DskipTests \ -Ddocker.registry=803424716218.dkr.ecr.eu-central-1.amazonaws.com \ clean package docker:push
- Scala
-
sbt -Ddocker.registry=803424716218.dkr.ecr.eu-central-1.amazonaws.com \ docker:publish