In this Video we are going to cover GitLab CI Build and Push Docker Image to AWS ECR | GitLab CI CD Docker AWS | Push Image to ECR
#gitlabcicddockeraws #gitlabcicd #pushimagetoecr
0:00 Introduction
5:00 GitLab CI Build and Push Docker Image to AWS ECR
Please find below Gitlab-ci.yml to GitLab CI Build and Push Docker Image to AWS ECR
variables:
DOCKER_REGISTRY: 908198849120.dkr.ecr.ap-south-1.amazonaws.com
APP_NAME: mavenapp
TAG: "$CI_COMMIT_SHORT_SHA-$CI_PIPELINE_ID"
stages:
- build
- build-docker-image
- push-image-to-aws-ecr
build-java-project:
stage: build
script:
mvn package
artifacts:
paths:
- /home/gitlab-runner/
build-docker-image:
stage: build-docker-image
script:
- docker info
- docker build -t $DOCKER_REGISTRY/$APP_NAME:"$TAG" .
Push Docker Image to AWS ECR:
stage: push-image-to-aws-ecr
image:
name: $DOCKER_REGISTRY/$APP_NAME:"$TAG"
services:
- docker:dind
script:
- aws ecr get-login-password --region ap-south-1 | docker login --username AWS --password-stdin $DOCKER_REGISTRY
- docker tag $DOCKER_REGISTRY/$APP_NAME:"$TAG" $DOCKER_REGISTRY/$APP_NAME:"$TAG"
- docker push $DOCKER_REGISTRY/$APP_NAME:"$TAG"
Complete GitLab CI CD Pipeline Tutorial for Beginners
https://www.fosstechnix.com/gitlab-ci...
Watch video #10:GitLab CI Build and Push Docker Image to AWS ECR | GitLab CI CD Docker AWS | Push Image to ECR online without registration, duration hours minute second in high quality. This video was added by user DevOps Hint 22 September 2021, don't forget to share it with your friends and acquaintances, it has been viewed on our site 7,273 once and liked it 82 people.