Mohak
3 min readApr 8, 2021

--

CI/CD Pipeline Integrating ECR with Jenkins

Pre-requisites:

  1. Instance configured with jdk, AWS-CLI, Docker and Jenkins package
  2. Starting services Docker and Jenkins
  3. Create one ECR repo

Interesting Steps are explained further !

Step 1: Configure your AWS-CLI by using -

aws configure

Step 2: Initiate your token for ECR to login by using command -

aws ecr get-login-password — region us-east-1 | docker login — username AWS — password-stdin 123456789.dkr.ecr.us-east-1.amazonaws .com

Step 3: Now for testing I’m here pulling one hello-world image from docker hub by using -

docker pull hello-world

Step 4: You can check your images using-

docker images

Step 5: We have to tag the docker image and push into ECR using this command —

For your reference I’m passing some past commands required for pre-requisites!

Step 6:

Next we have to setup our AWS credentials inside Jenkins admin account. So here’s the snapshot for your reference!

We can now setup our pipeline !

Step 7:

Creating pipeline for the code

Now Save and Build!

Here’s the console output of the pipeline

Your Image now has been successfully build and pushed to ECR and ready for the deployment!!

I hope you like it!

--

--