Build & Use Custom Docker images in your GitLab CI/CD pipeline

preview_player
Показать описание
The public images from Dockerhub don't always contain all the dependencies you need. So instead of adding a lot of commands to your pipeline, I will show you how easy it is to build a custom Docker image with all the dependencies you need, push it to the GitLab Container Registry and use it in your pipeline.
--

⭐️ 🎓 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.

If you are asking a question, make sure to include as many details as possible.

--

⭐️ 💡 I have a video idea ⭐️

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

--

⭐️ 📺 Learn GitLab on YouTube ⭐️

Collection of video tutorials:

▸ Learn GitLab CI:

___

⭐️ 📕 Free resources ⭐️

📌 Official Gitlab CI documentation

📌 DevOps with Valentine

--

⭐️ 📩 Contact & Imprint ⭐️

👉 Follow me on Twitter:

👉 Follow me on Medium:

👉 Follow me on Facebook:

👉 Let's connect on LinkedIn:

#gitlab #docker
__
Рекомендации по теме
Комментарии
Автор

Want to have ME be your GitLab & DevOps teacher? 🤔

vdespa
Автор

Hey Valentin! I have only two subscriptions, one is for Dave2D and one for you. This is what I am looking for, I already bought one of you Udemy course to dig deeper in GitLab. Thanks for the great instructions and the very clarified description. I am trying to learn as much as I can beside my 5 days old second son :D

danielmuranyi
Автор

AMAZING CI/CD tutorial, but just to make it the best ever a link to the repo would be great.

raphaelpereira
Автор

Can you show how to use Kaniko, Buildah, Podman

premierde
Автор

I have build a docker image locally and push it to a registry that can be reached publicly (needed sign in ofc), but whenever I tried to use this image from gitlab runner after the before script to sign in it alwasys complianed the image pull failure..

Invisileflyingdog
Автор

I think this part should be in your CI/CD udemy course with deploying this image

KVS
Автор

how can I use my custom image as a base image in my Dockerfile?
For example, my base image has all the dependencies and I want to use it to build my project. Is this possible? I tried to use it like so but it doesn't work:
FROM /myuser/myproject/base:v1.0.0
any ideas?

MilMike
Автор

oh... your title is kinda easy to missunderstand, i was looking for a way to
"Build & Use Custom Docker images in your GitLab CI/CD pipeline"

specifically i want to BUILD images, from INSIDE the gitlab CI/CD pipeline

do you by any chance have any solution for this?

EnderCrypt
Автор

I personally understand the thought that its bad practice to use latest.. but IMO.. it needs to be tested somewhere.. and for my personal proejcts I set latest.. so that at any time if something does break.. I find out about it right away.. otherwise things just run smoothly.. but I get in a job site that might not be tolerable to others

hwynightkid
Автор

Good one, , can we see from scratch about git and there setup with Linux machine and how and where image and containers going to

wajidshaikh
Автор

Nice video, thanks for you work!
Would you be able to create a tutorial for building your own docker images locally?

RuiDuartept
Автор

how did you handle the pull policy? if it is "if-not-present" the job never pull again your new image, but it will take always the previous...

lorenzorava
Автор

What if I have a docker-compose file ?
"docker-compose build -t $CI_REGISTRY_IMAGE ." does not work
How can I tag docker-compose ?

sebastiangehteuchnixan
Автор

I adjust an image that have all dependencies inside of it. Is this the nearest or the exact process that I should do? I only need gitlab runner to fetch image from local not from docker hub but I couldn't find a way and this tutorial is similar to what I wanted. Am I wrong?

omerguzel
Автор

on my personal gitlab instance i had to register the gitlab runner with the shell executor,
then i had to use docker:20.10.10-dind for image

erikwhitesides
Автор

Why build the Docker image on a schedule? Won’t it just build and push the same thing as it did the previous day if the Dockerfile hasn’t changed. And, if the Dockerfile has changed, wouldn’t you want to build a new image right away? Also, does it make sense to create and use a new tag each time the Dockerfile changes?

teeesen
Автор

I got your setup but.. when i go to apt install anything it says source not found? using ubuntu:20.04 it cannot find things as simple as apt install python3 .. I will go to the gitlab community next to see what I missed.. thanks for the great video tho to kick start my efforts

hwynightkid
Автор

Thanks for the video. I run this code to create a custom docker image but i get an error saying:
Cannot connect to the Docker daemon at tcp://docker:2375. Is the docker daemon running?
Any idea how can I solve this problem? I already set tls=false but still not working

TheMaurober
Автор

What is advantage of creating and using a yaml ci build file over a Dockerfile to create your image?

firo
Автор

you did the build... but not the use...

ipcnmbe