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

  Рет қаралды 106,259

Valentin Despa

Valentin Despa

Күн бұрын

Пікірлер: 52
@vdespa
@vdespa 2 жыл бұрын
Want to have ME be your GitLab & DevOps teacher? 🤔 Here's how: vdespa.com/courses/
@danielmuranyi3556
@danielmuranyi3556 Жыл бұрын
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
@vdespa
@vdespa Жыл бұрын
I appreciate that, Daniel. Thank you! Take it easy with learning, make it fun, not a burden ;)
@raphaelpereira1503
@raphaelpereira1503 Жыл бұрын
AMAZING CI/CD tutorial, but just to make it the best ever a link to the repo would be great.
@vdespa
@vdespa Жыл бұрын
You are welcome. Thank you for leaving a comment.
@opensourceaarsaan6759
@opensourceaarsaan6759 2 жыл бұрын
cool & perfect Thanks a lot
@vdespa
@vdespa 2 жыл бұрын
You are welcome. Thank you for leaving a comment.
@KVS797
@KVS797 2 жыл бұрын
I think this part should be in your CI/CD udemy course with deploying this image
@vdespa
@vdespa 2 жыл бұрын
Thanks for your suggestion. I am expanding the course to include Docker as well.
@wajidshaikh5619
@wajidshaikh5619 2 жыл бұрын
Good one ,, can we see from scratch about git and there setup with Linux machine and how and where image and containers going to
@premierde
@premierde 7 ай бұрын
Can you show how to use Kaniko, Buildah, Podman
@ha3anabedi457
@ha3anabedi457 2 жыл бұрын
it's great thanks you
@vdespa
@vdespa 2 жыл бұрын
You are welcome!
@hwy9nightkid
@hwy9nightkid 2 жыл бұрын
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
@RuiDuartept
@RuiDuartept 2 жыл бұрын
Nice video, thanks for you work! Would you be able to create a tutorial for building your own docker images locally?
@vdespa
@vdespa 2 жыл бұрын
Thanks. You can use the same commands I have shown you locally as well.
@erikwhitesides
@erikwhitesides 2 жыл бұрын
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
@vdespa
@vdespa 2 жыл бұрын
If you are using a shell executor, any image you specify in your pipeline config is ignored.
@gl1mpse00
@gl1mpse00 Ай бұрын
Do I need to add the code below if I dont have docker in local and only want to build a custom docker in GitLab? services: - docker:dind
@Invisileflyingdog
@Invisileflyingdog 7 ай бұрын
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..
@MilMike
@MilMike 8 ай бұрын
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?
@lorenzorava7511
@lorenzorava7511 2 жыл бұрын
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...
@vdespa
@vdespa 2 жыл бұрын
Good point. The safest way is to use tags.
@lorenzorava7511
@lorenzorava7511 2 жыл бұрын
@@vdespa mm, difficult to automate in this case. You should change the tag manually in some point...
@vdespa
@vdespa 2 жыл бұрын
@@lorenzorava7511 I mean there is not single solution for all problems. You need to test different options and see what works for you.
@EnderCrypt
@EnderCrypt Жыл бұрын
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?
@brahamaggarwal1800
@brahamaggarwal1800 Ай бұрын
Hey Valentin, does this automatically do 'Docker Layer Caching' while building the image or do I have to do some additional configurations. I am currently using AWS ECR and every time I build the image it takes too long because the gitlab runner does not have a reference to the previously built image. Can you please clarify this. Thanks in advance.
@vdespa
@vdespa Ай бұрын
@@brahamaggarwal1800 By design, each job is started in a new Docker image. So there are no previous builds or cache that can be reused. How long does it take?
@omerguzel8351
@omerguzel8351 Жыл бұрын
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?
@teeesen
@teeesen 2 жыл бұрын
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?
@vdespa
@vdespa 2 жыл бұрын
Good points. Well, it depends. What if you don't use a tag in your base image? But yes, using tags makes sense.
@sebastiangehteuchnixan42
@sebastiangehteuchnixan42 Жыл бұрын
What if I have a docker-compose file ? "docker-compose build -t $CI_REGISTRY_IMAGE ." does not work How can I tag docker-compose ?
@firo1934
@firo1934 2 жыл бұрын
What is advantage of creating and using a yaml ci build file over a Dockerfile to create your image?
@wgray8231
@wgray8231 Жыл бұрын
you still use a Dockerfile -- this CI yaml just gives the gitlab runner the instructions on executing docker build
@hwy9nightkid
@hwy9nightkid 2 жыл бұрын
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
@vdespa
@vdespa 2 жыл бұрын
I suggest taking an image that already has python.
@TheMaurober
@TheMaurober Жыл бұрын
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
@vdespa
@vdespa Жыл бұрын
Hey Mauro, are you using the shared runners from GitLab.com or are you self-hosting...?
@TheMaurober
@TheMaurober Жыл бұрын
@@vdespa hi, I'm using self-hosted
@vdespa
@vdespa Жыл бұрын
@@TheMaurober Please see the Troubleshooting part of this article. medium.com/p/b63b91a58728
@TheMaurober
@TheMaurober Жыл бұрын
@@vdespa Thanks!!
@CraigEgan-d5b
@CraigEgan-d5b Жыл бұрын
you did the build... but not the use...
@zembelallan5768
@zembelallan5768 2 жыл бұрын
I want to push a Java image to ECR, then how to make a CD?
@vdespa
@vdespa 2 жыл бұрын
For ECR, please watch this tutorial: kzbin.info/www/bejne/oJicpIiZmt56l7M
@makondoo
@makondoo Жыл бұрын
i am impressed how bad and unclear this video is
@vdespa
@vdespa Жыл бұрын
Let me know if you have any questions and what is unclear?
@user-18873ty
@user-18873ty 2 жыл бұрын
Thanks for the video! I am having this issue Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running?
@vdespa
@vdespa 2 жыл бұрын
Try using the shared runners from GitLab.com
@ngocthiennguyen3318
@ngocthiennguyen3318 Жыл бұрын
when i'm login, message return error during connect: Post "docker:2375/v1.24/auth": dial tcp: lookup docker on 8.8.8.8:53: no such host
@bossdarkkiller
@bossdarkkiller 2 жыл бұрын
I get this error: "error during connect: Post "docker:2375/v1.24/auth": dial tcp: lookup docker on **:53: no such host" ---- Anyone know the solution?
@mariobuser6656
@mariobuser6656 2 жыл бұрын
Dito. Would also be interested in a solution.
@DeadlyDragon_
@DeadlyDragon_ Жыл бұрын
you need to use tcp:// not http its not a web server
GitLab CI/CD Pipeline Tutorial for Beginners (2024)
19:33
Valentin Despa
Рет қаралды 21 М.
GitLab CI CD Pipeline Tutorial | Introduction | 2022
34:43
Tech and Beyond With Moss
Рет қаралды 241 М.
SHAPALAQ 6 серия / 3 часть #aminkavitaminka #aminak #aminokka #расулшоу
00:59
Аминка Витаминка
Рет қаралды 2,6 МЛН
小路飞嫁祸姐姐搞破坏 #路飞#海贼王
00:45
路飞与唐舞桐
Рет қаралды 27 МЛН
ДЕНЬ УЧИТЕЛЯ В ШКОЛЕ
01:00
SIDELNIKOVVV
Рет қаралды 3,6 МЛН
Build YOUR OWN Dockerfile, Image, and Container - Docker Tutorial
18:20
Using docker in unusual ways
12:58
Dreams of Code
Рет қаралды 453 М.
How to test a Docker container in GitLab CI
15:48
Valentin Despa
Рет қаралды 17 М.
GitHub Actions Tutorial - Basic Concepts and CI/CD Pipeline with Docker
32:31
TechWorld with Nana
Рет қаралды 1,5 МЛН
How to design a modern CI/CD Pipeline
9:59
DevOps Journey
Рет қаралды 139 М.
GitLab CI - Create a Docker image and upload it to GitLab and Docker Hub
26:41
Tobi's Developer Corner
Рет қаралды 18 М.
SHAPALAQ 6 серия / 3 часть #aminkavitaminka #aminak #aminokka #расулшоу
00:59
Аминка Витаминка
Рет қаралды 2,6 МЛН