-
Notifications
You must be signed in to change notification settings - Fork 888
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Can't use docker on slaves #140
Comments
In the latest tutorial the Docker socket is no longer being mounted in to the agents. For building the images you should use: or |
I tried using below one which works fine. https://github.com/jenkinsci/kubernetes-plugin/blob/master/examples/docker.groovy @viglesiasce any reason why one should not use this. |
Mounting the docker socket exposes the underlying node and possibly the entire cluster to any build that runs because Docker is generally running as root these days. This should only be done in situations where you fully trust the CI workload and the folks who can alter its contents. |
Hi @viglesiasce , I just migrated from GCE to GKE and I'm no longer able to bind host docker into agent (it says during docker pull that there is a Now you tell that's a pretty bad practice, I'm looking for a way to embed Docker into my build, any advice? In my case depending on the stages I used different docker images (build/test/...) using this:
What could simulate this behavior? Installing a docker client into my jnlp image? But is it a good practice also? Thank you, |
Hey @sneko! You would have to create a mount of the docker socket and docker binary from the GKE node to the Jenkins agent pod. Here is an example: |
Hi @viglesiasce , As you mentioned last year #140 (comment) it's a pretty bad practice to mount from the daemon from the node. Why do you advise this today, any change ^^? On my side I started using https://github.com/genuinetools/img that uses same CLI commands than docker and doesn't require all the stuff the official Docker CLI needs. I'm really happy with it. So to sum up, I run a container "img" for the steps that need to build some Dockerfiles. During my research I also saw https://github.com/GoogleContainerTools/kaniko from Google, but I don't know, read a lot about both and I just made a choice. I hope it will help someone! |
I followed the last update on the tuto (installed jenkins using Helm), the difference is I use a git repo to pull my project.
I'd like to start with running docker on the slaves to push images on my GKE repo (like I used to do with the first version of the tuto).
I use the latest proposed jenkinsfile with a docker builder but I have this error
Here is the jenkinsfile used:
here is the full log:
Thank you in advance
Philippe
The text was updated successfully, but these errors were encountered: