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

แชร์
ฝัง
  • เผยแพร่เมื่อ 20 พ.ย. 2024

ความคิดเห็น •

  • @vdespa
    @vdespa  3 ปีที่แล้ว +3

    Want to have ME be your GitLab & DevOps teacher? 🤔
    Here's how: vdespa.com/courses/

  • @danielmuranyi3556
    @danielmuranyi3556 ปีที่แล้ว +2

    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.

  • @premierde
    @premierde 8 หลายเดือนก่อน +1

    Can you show how to use Kaniko, Buildah, Podman

  • @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

  • @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.

  • @RuiDuartept
    @RuiDuartept 3 ปีที่แล้ว +3

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

    • @vdespa
      @vdespa  3 ปีที่แล้ว

      Thanks. You can use the same commands I have shown you locally as well.

  • @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

  • @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.

  • @opensourceaarsaan6759
    @opensourceaarsaan6759 2 ปีที่แล้ว +1

    cool & perfect
    Thanks a lot

    • @vdespa
      @vdespa  2 ปีที่แล้ว

      You are welcome. Thank you for leaving a comment.

  • @lorenzorava7511
    @lorenzorava7511 2 ปีที่แล้ว +1

    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.

  • @Invisileflyingdog
    @Invisileflyingdog 9 หลายเดือนก่อน

    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..

  • @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?

  • @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?

  • @MilMike
    @MilMike 9 หลายเดือนก่อน

    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?

  • @brahamaggarwal1800
    @brahamaggarwal1800 2 หลายเดือนก่อน

    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  2 หลายเดือนก่อน

      @@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?

  • @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

  • @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 ปีที่แล้ว +1

      Good points. Well, it depends. What if you don't use a tag in your base image?
      But yes, using tags makes sense.

  • @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.

  • @ha3anabedi457
    @ha3anabedi457 2 ปีที่แล้ว

    it's great thanks you

    • @vdespa
      @vdespa  2 ปีที่แล้ว

      You are welcome!

  • @TheMaurober
    @TheMaurober 2 ปีที่แล้ว

    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  2 ปีที่แล้ว

      Hey Mauro, are you using the shared runners from GitLab.com or are you self-hosting...?

    • @TheMaurober
      @TheMaurober 2 ปีที่แล้ว

      @@vdespa hi, I'm using self-hosted

    • @vdespa
      @vdespa  2 ปีที่แล้ว +1

      @@TheMaurober Please see the Troubleshooting part of this article. medium.com/p/b63b91a58728

    • @TheMaurober
      @TheMaurober 2 ปีที่แล้ว

      @@vdespa Thanks!!

  • @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 ?

  • @zembelallan5768
    @zembelallan5768 3 ปีที่แล้ว

    I want to push a Java image to ECR, then how to make a CD?

    • @vdespa
      @vdespa  3 ปีที่แล้ว

      For ECR, please watch this tutorial: th-cam.com/video/jg9sUceyGaQ/w-d-xo.html

  • @CraigEgan-d5b
    @CraigEgan-d5b ปีที่แล้ว +1

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

  • @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 2 ปีที่แล้ว

    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