Pushing Docker Image from local machine to Amazon Elastic Container Registry Repositories
This post briefly documents the process of pushing a Docker Image of a Spring Boot based Web App from local machine to Amazon Elastic Container Registry Repositories.
Introduction
Docker is a set of platform as a service products that use OS-level virtualization to deliver software in packages called containers. Containers are isolated from one another and bundle their own software, libraries and configuration files; they can communicate with each other through well-defined channels.
Amazon Elastic Container Registry (Amazon ECR) is a fully managed container registry that makes it easy to store, manage, share, and deploy your container images and artifacts anywhere.
Goals
- Select Elastic Container Service
- Create Repository
- Configure Repository Settings
- View Docker Push Commands
- Push the Docker Image
- View the pushed image & its details
Minimum Software Requirements
- Docker
- Access to AWS Management Console
Getting Started
Setup
Start your local Docker Instance if necessary.
Navigate to your project folder where Dockerfile is present and build a Docker image of the project using the following command.
docker build -t YOUR_PROJECT_NAME .
Step 1 - Select Elastic Container Service
From the AWS Services, select the Elastic Container Service from the Containers section
Step 2 - Create Repository
On the left side navigation menu, in the Amazon ECR section, click on the Repositories option.
On the next page, click on the Create repository button.
Step 3 - Configure Repository Settings
In the General Settings section, choose the visibility settings for the repository to be Private or Public as per the need.
Give the repository a suitable Name
Click on the Create repository button.
Step 4 - View Docker Push Commands
Once, the repository is created. Click on the View Push Commands button made available on the top banner.
As per your Operating System, copy the commands.
Step 5 - Push the Docker Image
execute the commands copied in the previous step in a sequential order to push the Docker image fom your local machine to AWS ECR.