Gitlab CI: Build & push Docker image to AWS ECR (Elastic Container Registry)

preview_player
Показать описание
Publishing a Docker image to Amazon Elastic Container Registry (ECR) is a bit different than it works with other containers. In this tutorial, I will show you how to build and publish a Docker image from Gitlab CI.

AWS CLI reference:

___

// GitLab CI/CD ONLINE COURSE

👉 Want to learn more about CI/CD pipelines? Check my GitLab CI online course.

Get it at a special price and help support this YouTube channel:

___

// I HAVE A QUESTION!

I do my best to answer all comments here on YouTube but I cannot make any guarantees.

___

// I HAVE A VIDEO IDEA

Do you want me to create a video on a specific topic? Just fill out the form below:

___

// P L A Y L I S T S

___

// F R E E R E S O U R C E S

▸▸▸ Official Gitlab CI documentation

▸▸▸ 👉 Subscribe to the "Testing and automation with Valentine" newsletter for bi-weekly tutorials, tips, and news from the industry.

___

// YOUR SUPPORT ON PATREON MATTERS

If you enjoy this content, help me create more like this. Consider supporting me on Patreon.

___

// IMPRINT

---
Рекомендации по теме
Комментарии
Автор

👉 Want to learn more about CI/CD and DevOps? Check my Gitlab CI online course.

vdespa
Автор

Excellent tutorial, Valentin. Everything explained very clearly and concisely. And I really liked how you showed how the .gitlab-ci.yml evolved and why it evolved that way. Nicely done!

anthonycollins
Автор

If you can't get past the AWS CLI Login..

First, check if you're running against a "Protected" branch. If you're not, that is probably the reason.
By default when setting the Variable, the "Protected" tagged is checked.
As defined by GitLab, Protected variables are only exposed to protected branches or tags.



The solution to this is to either include that branch with the "Protected" tag or uncheck the "Protected" tag in the variable.
Master branches have a "Protected" tag by default.

xiaopang
Автор

man! the order you explains is perfect! thank you very much! you dont just start writing, you have an order and excellent way to teach us, thanks

FelipeDouradinho
Автор

great video! and just to update one thing that is missing nowadays:we also have to configure inside the variables the TLS certificate: DOCKER_TLS_CERTDIR: "". otherwise, docker will be available through port 2736 and not 2735. Well, at least I run into this issue with gitlab and that was how I fixed it :) But thanks for your video! really helped me!

rafaelmariotti
Автор

This is amazing. Actually I just bougth your Udemy course... you explain things in a very clear way.. Thanks

davidpccode
Автор

Really appreciate the content and the knowledge that you share with us in this video. It is very helpful and probably I will implement it for my projects.

Thank you!

jfgomez
Автор

my friend is excellent better than many pied training.

joepinto
Автор

Please make video on automatically deployment on AWS ECS fargat using gitlab cicd

mayureshpatilvlogs
Автор

Great Job. I was able to follow along. I just had to add the variable DOCKER_TLS_CERTDIR. Could you use docker:dind as the base image and install aws-cli in it?

idouxda
Автор

I keep failed to follow gitlab official document, but finally I did work from your video!
Thanks a lot!
looks like gitlab-ci 's deploy image is outdated or something wrong with official doc :/

changwonjeong
Автор

excellent one, thanks for sharing, can u share if u have done same with Kaniko in place of docker deamon .

arunreddy
Автор

I got some issues running gitlabCI where the company forces to use their private registry for the images (they use jfrog). I would really appreciate if you could make tutorial video for gitlabCI using private registry

hiukecil
Автор

Thanks brother! Now i need to find how to use the pipeline to grab it from the registry and deploy it to AWS ECS FARGATE.

omarsuriel
Автор

Did you include how you specify with gitlab runner is used, where that gitlab runner is running, and how that runner has to be setup? I might have missed it.

maladil
Автор

where did you run the command in gitlab for running the project??

rajashekhar
Автор

Wouldn't this mean that anyone that knows our docker registry can easily use aws erc get-login-password to deploy anything to our registry?

obinnaezedei
Автор

you have a the video with a example with docker-compose push to ecr from pipeline gitlab?

hernanricardoperaltasanche
Автор

Great video and really helpful.
Just a concern, we are restricted using AWS Access Keys anywhere and advised to use IAM instance roles on our self runners.
It would be really helpful if you can create a video to build and push images using IAM instance profile without using AWS Acces keys.
Thanks in advance.

vipul
Автор

Thanks Valentin for this tuto, I am trying to push my docker image using jib, I used the same logic and I added a new step to launch the "mvn clean compile jib:build" but I have a 401 http code, must I combine these two steps, if yes how can I use two images in the same step (docker + maven) ?

ahmedhormal