Pushing a docker image to aws ECR through jenkins pipeline

phases:
install:
runtime-versions:
java: openjdk8
docker: 18
python: 3.7

pre_build:
commands:
- chmod +x gradlew
- echo Logging in to Amazon ECR...
- $(aws ecr get-login --no-include-email --region us-east-1)
build:
commands:
- echo Build started on `date`
- ./gradlew build -x test
- echo Building the Docker image...
- docker build -t cp-batch .
- docker tag {tags to tag the image }
post_build:
commands:
- echo Build completed
- echo Pushing the Docker images...
- docker push {ECR account name}

--

--

Software Engineering Intern @ mubasher technologies

Love podcasts or audiobooks? Learn on the go with our new app.

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Sithija Thewahettige

Sithija Thewahettige

Software Engineering Intern @ mubasher technologies