Тёмный

How to Setup Docker Containers As Build Agents for Jenkins 

CloudBeesTV
Подписаться 35 тыс.
Просмотров 77 тыс.
50% 1

Опубликовано:

 

30 окт 2024

Поделиться:

Ссылка:

Скачать:

Готовим ссылку...

Добавить в:

Мой плейлист
Посмотреть позже
Комментарии : 68   
@henryborchers1001
@henryborchers1001 3 года назад
Dockerfile based agents was the biggest game changer for Jenkins for me.
@mithuntechtraining
@mithuntechtraining Год назад
Hi Darin You and your videos are awesome and very informative as always. But could you please make a video on how to use docker as dynamic slave agents by building a custom docker image and use that whenever there is requirement in the job. Thanks Mithun
@vinaykumar-qq9wq
@vinaykumar-qq9wq 11 месяцев назад
Excellent narrative style. Really appreciate your efforts ❤
@basamnath2883
@basamnath2883 3 месяца назад
Amazing teaching. Just awesome and thank you
@kimwkahler7381
@kimwkahler7381 2 года назад
Great video! Automated deployment on a box that only exists while Jenkins is building. Surreal :)
@riteshwalia1295
@riteshwalia1295 2 года назад
HI Darin, I have my Jenkins running on docker so how do i create the docker build agents. Could you please share what additional configurations are required for that
@scribblespoon1919
@scribblespoon1919 3 месяца назад
Docker was not found. I'm guessing there are some other prerequisits other than the plugins. The documention of the docker pipeline plugin didn't help me as well.
@sambasivam
@sambasivam 2 года назад
how does it run at agent? is there any additional config settings missing? Everytime I run it will execute in master and throw error docker not found. any help?
@miguelcastorena4293
@miguelcastorena4293 2 месяца назад
You need to install Docker
@bambamty
@bambamty 5 месяцев назад
I am trying to run ESP-IDF docker with a 'build-wrapper' inside of it to generate build files for an ESP32. When I do this Jenkins complains as it looks like my 'builder' node is running these, when it should be my Docker container. I don't want to install them on the node as then i'll be unable to swap dependencies on a per-project basis. Any help is greatly appreciated!
@N1mdae
@N1mdae 2 года назад
This seems fantastic. One question : If we have Jenkins running as a docker image. Is there any problem or consideration with the setup?
@azaifel
@azaifel 2 года назад
Excellent tutorial! thanks
@BryanIngking-k2x
@BryanIngking-k2x 8 месяцев назад
Hi Darren, just wondering if agent1 is running inside a docker container as I am currently seeing errors when trying to follow the guide you made in here?
@JayeshRaina-b8m
@JayeshRaina-b8m Год назад
How can I stop in remoivng the containers in pipline, there is no code to make sure container remains after job is finished.
@Rahul-hx9dz
@Rahul-hx9dz 6 месяцев назад
Hey how do I setup windows server which contains docker deamon running in it as agent.. so that I can run my groovy pipeline script in dynamically created container on agent ?
@pazfelipe
@pazfelipe 3 года назад
Hi Darin. Could you make a video showing how to execute these steps inside a jenkins docker image?
@AndreSantos-hd7iw
@AndreSantos-hd7iw 2 года назад
You need to run jenkins container mapping volume to docker socket. That way the docker commands executed inside the container will be executed on the host. --volume /var/run/docker.sock:/var/run/docker.sock
@s.i.m.c.a
@s.i.m.c.a Год назад
@@AndreSantos-hd7iw but would you expose the docker.socket to the Agent? it is an security risk. For example, you would able to kill Jenkins agent from the job or any another non-relevant to the Jenkins container.
@yashhirulkar909
@yashhirulkar909 2 года назад
sir i am getting this error while using docker as agent .What shud i do please? failed to register layer: Error processing tar file(exit status 1): open /etc/rdma/modules/roce.conf: no space left on device
@kushsharma6653
@kushsharma6653 2 года назад
Thanks for this awesome video. Keep sharing more! One question: What if I want to use Jenkinsfile-3 with node image, curl and git but I also want to have docker installed on this image? What would be the dockerfile code like? Thanks in the advance. :D
@RaviSharma-vw7py
@RaviSharma-vw7py 2 года назад
Thanks Darin ! Nice !
@sebastianfarias5670
@sebastianfarias5670 2 года назад
OMG best video ever ! thank you !!!
@אופקגולדשטיין-ר2ס
@אופקגולדשטיין-ר2ס 3 месяца назад
How did you install docker cli on the agent?
@rbelatamas
@rbelatamas 2 года назад
thanks this really useful video!
@sathishsubramanian2510
@sathishsubramanian2510 2 года назад
Hi Darin, I have a doubt that for building docker image should we need to run jenkins inisde docker container or from war file we can use jenkins?
@anthonywhitehead8182
@anthonywhitehead8182 3 года назад
fantastic content, thank you
@anthonywhitehead8182
@anthonywhitehead8182 3 года назад
Hi Darin, I've been following your examples, thank you. I'm not sure if you answer questions here, but I've got a docker-compose setup with nginx and the blueocean jenkins container (created from ansible) working nicely, along with configuration as code. I'm trying to create a build agent but am stuck with and haven't been able to resolve 'got permission denied while trying to connect to the docker daemon socket'. I'd like the agent to be another docker container in docker-compose based on the inbound-agent container. Am I going around this ok, or should I just give in and create a real vm as an agent rather than a docker one?
@sumanta8504
@sumanta8504 2 года назад
if you are getting 'got permission denied while trying to connect to the Docker daemon socket' that means Jenkins user does not have the access permission. So in that case add jenkins user in docker group, hope that will resolve the issue
@aleexdds
@aleexdds 11 месяцев назад
Amazing Videos
@digitallova
@digitallova Год назад
what about slave nodes on the cloud? what kind of directives to put to execute a docker agent in a node on the cloud?
@rohanrustagi7857
@rohanrustagi7857 Год назад
hey can I add docker build stage in the same pipeline ?
@staj
@staj Год назад
Brilliantly done. Great Information. Thanks.
@0kaschei0
@0kaschei0 2 года назад
Thank you
@vijjisanthi1922
@vijjisanthi1922 2 года назад
Hello Darin currently iam running jenkins from ec2 is there any possibility to move from ec2 to ecs without loosing my data and configuration
@lalitshukla6585
@lalitshukla6585 2 года назад
Thanks Sir.. Can we use a Jenkins upstream job to create multiple slaves ? if yes please explain.
@master2466
@master2466 2 года назад
What if the docker host is out there on network as opposed to on Jenkins host?
@nandiniachugatla932
@nandiniachugatla932 8 месяцев назад
How can we add docker in jenkins image ??
@danish6192
@danish6192 3 года назад
perfect !
@rayc6556
@rayc6556 2 года назад
i am using image jenkins/jenkins:lts-jdk11, and the pipeline gave me error docker: not found. Anyone have the same experience and how to solve?
@shilashm5691
@shilashm5691 2 года назад
You are not alone😪
@shilashm5691
@shilashm5691 2 года назад
Do you got any solution?
@AndreSantos-hd7iw
@AndreSantos-hd7iw 2 года назад
You must create a custom image based on jenkins/jenkins:lts-jdk11 and install docker on it
@AndreSantos-hd7iw
@AndreSantos-hd7iw 2 года назад
And run jenkins container mapping volume to docker socket. That way the docker commands executed inside the container will be executed on the host. --volume /var/run/docker.sock:/var/run/docker.sock
@s.i.m.c.a
@s.i.m.c.a Год назад
it's an docker-in-docker concept and before implementing it, you should weight the risks like - all jobs and containers, including the one belongs to agent would be exposed to the user pipeline. Basically user with his own pipeline would be able to manipulate any another user pipeline and shut down the agent itself. This stuff could be used only in non-critical environment or in a lab. If it is used in production - get ready to be hacked (especially if there are a different level access to different pipelines)
2 года назад
how can use this with docker daemon with remote docker ?
@StevePrior
@StevePrior 2 года назад
I thought this was a very helpful video, but have a concern about the second example which I found out the hard way. When you have two different agents in play Jenkins creates separate workspaces for each, so any files created by the first maven agent won't be available to the second agent. In my case I had a build stage that used a containerized build tool and I wanted the artifact created by that tool to be available to a second stage which was not running in the docker container. So I ended up using agent any at the toplevel, then specified reuseNode true within the agent of the first stage (which runs the docker container), then no agent specified for the second stage. This resulted in an overall agent workspace for the pipeline, but then the first stage running in a docker container but not creating a new workspace to do so, so the next stage would still be using the same workspace. I'm sure I still have lots of tricks to learn, but it would be great if CloudBees produced a video on this.
@s.i.m.c.a
@s.i.m.c.a Год назад
it's an Jenkins basics - the stages could be executed on a different agents, and you could instruct Jenkins to do it in a parallel.
@backendjava
@backendjava 3 месяца назад
teach how to do it with a docker based jenkins install
@Sathurjan11
@Sathurjan11 11 месяцев назад
Still waiting to schedule task Waiting for next available executor
@kayoutube690
@kayoutube690 5 месяцев назад
These the docker build is not work for this tutorial.
@irfansadiq
@irfansadiq 2 года назад
Will it pick any agent wit label Linux?
@sambasivam
@sambasivam 2 года назад
how does it know when it is not specified in the Jenkinsfile?
@RajaAnbazhagan
@RajaAnbazhagan Год назад
Aha. This one uses the local docker on the available agent to run the stuff. Was confusing it with docker cloud agents themselves.
@thecoasterfollower3564
@thecoasterfollower3564 Год назад
How can we run docker commands on the docker cloud agents? All these tutorials including his do it on the built in node which isn’t recommended
@thecoasterfollower3564
@thecoasterfollower3564 Год назад
But these all run on the built in node? Isnt the point of docker agents to use it on a docker cloud node? And you can't even run docker commands in any of these, where alot of apps are ran on docker in the first place. I don't understand how this is any different from just using docker cloud nodes. I need to run docker inside of the docker cloud nodes themselves, this video is misleading because you still are building on the built in node.
@abhijitshubham9730
@abhijitshubham9730 Год назад
Hi @thecoasterfollower3564, were you able to find the solution as to how I can use a Dockerfile to create Docker container as node and then build docker image inside it?
@Adventurevictoria
@Adventurevictoria Год назад
You have been told that the agent has been installed docker but actually, the agent was running out side of docker as you can see from 5:45 . Im spend over week to find a solution to create docker agent that actually running in side docker and still doing all docker command job include docker compose , currently I was able to run successfully docker command in side docker agent which is running in side docker and build as well but not able to RUN!!!!!! anyone who made it ?????
@connerwhite5351
@connerwhite5351 Год назад
docker: not found
@weilin4872
@weilin4872 6 месяцев назад
The same bro, 🤣
@vijjisanthi1922
@vijjisanthi1922 2 года назад
Can u pls help out me on this
@andreeliasoliveira6131
@andreeliasoliveira6131 Год назад
Honestly if it weren't for Darin's videos Jenkins would be unusable
@shantanuparanjpe8363
@shantanuparanjpe8363 2 года назад
Hi Darin, i am trying to run the jenkins pipeline stages inside a docker agent. I am using the centos-8 on my host machine. I am getting below error while running the build java.io.IOException: Failed to run top 'fab543e3693ea5258e92d440b2e043d58aaf09c98e25f19e1d85c416ea5f4c93'. Error: Emulate Docker CLI using podman. Create /etc/containers/nodocker to quiet msg. Error: top can only be used on running containers Jenkinsfile: pipeline { environment { DOCKERHUB_CREDENTIALS = credentials('dockerhub') } agent { docker { image 'ubuntu:latest' alwaysPull true } } stages { stage('Build') { environment { HOME="." } steps { script { sh '/usr/local/bin/docker build -t test .' } } } stage('Login') { steps { sh 'echo $DOCKERHUB_CREDENTIALS_PSW |/usr/local/bin/docker login -u $DOCKERHUB_CREDENTIALS_USR --password-stdin' } } stage('Push') { steps { script { sh '/usr/local/bin/docker push *****/test' } } } } }
@Hakob771
@Hakob771 2 года назад
Here is the issue, who can help? I tried agent { dockerfile true }, Jenkins was creating docker container, after that it didn't go through stages, i mean it stuck after creating docker container, job is not ending, minutes are going, but content in steps block dont' work
@girishananda8604
@girishananda8604 3 года назад
Sucks! Just polluting internet with lack of info.
@TheExplorist
@TheExplorist Год назад
+ docker inspect -f . node:18.16.0-alpine Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running? facing even docker desktop everything running and I can build the image from my local computer as well
@yukinoryu
@yukinoryu 27 дней назад
if used brew, install docker via brew cask , so run: brew install --cask docker
Далее
How to Use Kubernetes Pods As Jenkins Agents
25:15
Просмотров 57 тыс.
Getting Started With Shared Libraries in Jenkins
23:23
Don't bother ganking Ammar - ESL Dota 2
00:23
Просмотров 93 тыс.
Family♥️👯‍♀️🔥 How old are you? 🥰
00:20
How to Run Jenkins on Docker
13:59
Просмотров 18 тыс.
How to Create an Agent Node in Jenkins
23:57
Просмотров 98 тыс.
Learning Docker // Build Container Images
23:02
Просмотров 34 тыс.
How to Use Docker Compose With Jenkins
8:52
Просмотров 24 тыс.