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

`docker` executable not available to run `docker build` and `docker push` #14

Open
cyrille-leclerc opened this Issue Nov 17, 2015 · 11 comments

Comments

Projects
None yet
6 participants
@cyrille-leclerc
Copy link
Contributor

cyrille-leclerc commented Nov 17, 2015

docker executable not available to run docker build and docker push.

@cyrille-leclerc

This comment has been minimized.

Copy link
Contributor

cyrille-leclerc commented Nov 17, 2015

@ndeloof

This comment has been minimized.

Copy link
Member

ndeloof commented Nov 18, 2015

until you run Docker in Docker this doesn't make more sense
and if you don't, and just bind mount /var/lib/docker.sock, then it's safer to also bind mount /usr/bin/docker to ensure you run the correct docker cli version

@michaelneale

This comment has been minimized.

Copy link
Member

michaelneale commented Nov 18, 2015

agree with @ndeloof. Docker-in-Docker is not a recommended solution for anyone and not supported. Bind mounting in both the docker socket and binary is recommended way and requires nothing else installed.

@cyrille-leclerc

This comment has been minimized.

Copy link
Contributor

cyrille-leclerc commented Nov 18, 2015

@michaelneale @ndeloof How can a job running in a container (cloud slave provided by jenkins-kubernetes, jenkins-mesos, jenkins-amazon-ecs) can create an image and push it to a registry?

I am not asking to do a docker run from this jenkins build.

@ndeloof

This comment has been minimized.

Copy link
Member

ndeloof commented Nov 18, 2015

Both docker build and push commands do run on daemon, not client.
Considering a kibernetes / mesos hosted container as a plain classic
Jenkins slave is a misconception
Le 18 nov. 2015 4:39 PM, "Cyrille Le Clerc" notifications@github.com a
écrit :

@michaelneale https://github.com/michaelneale @ndeloof
https://github.com/ndeloof How can a job running in a container (cloud
slave provided by jenkins-kubernetes, jenkins-mesos, jenkins-amazon-ecs)
can create an image and push it to a registry?

I am not asking to do a docker run from this jenkins build.


Reply to this email directly or view it on GitHub
#14 (comment)
.

@cyrille-leclerc cyrille-leclerc changed the title `docker` executable not available to do "docker push" and "docker build" `docker` executable not available to do "docker build" and "docker push" Nov 20, 2015

@cyrille-leclerc cyrille-leclerc changed the title `docker` executable not available to do "docker build" and "docker push" `docker` executable not available to run `docker build` and `docker push` Nov 20, 2015

@t5unamie

This comment has been minimized.

Copy link

t5unamie commented Apr 21, 2016

+1

I have a similar issue. I am running Jenkins on Kubernetese. I normally use just start Jenkins on RAW docker. However I ave switched to Rancher/Kubernetese. I have a Jenkins slave running using the kubernetese plugin. I get the following issue.

docker build -t hub.docker.com/testing/testing_quickstart:29 --pull=true --file=docker/ /home/jenkins/workspace/01-DEV/01-testing/03-Packaging
ERROR: Cannot run program "docker" (in directory "/home/jenkins/workspace/01-DEV/01-testing/03-Packaging"): error=2, No such file or directory

I have put "-v $(which docker):/usr/bin/docker" into "Arguments to pass to the command" and mapped /var/run/docker.sock under the volume configuration.

Any help appeciated

@ndeloof

This comment has been minimized.

Copy link
Member

ndeloof commented Apr 24, 2016

@t5unamie -v $(which docker):/usr/bin/docker won't work as $(which docker) is resolved on client machine, not docker host. You need to assume docker is installed on standard /usr/bin/docker location on host or get this information from administrator.

@vishaltelangre

This comment has been minimized.

Copy link

vishaltelangre commented Apr 20, 2017

Same issue. I have installed Jenkins on Kubernetes. I am trying to build a docker image and push it to the registry from the Jenkins build but it throws Cannot run program "docker" (in directory "/home/jenkins/workspace/myjob"): error=2, No such file or directory error.

@dingyeah33

This comment has been minimized.

Copy link

dingyeah33 commented Jan 14, 2018

Hi there, I am running my Jenkins as a POD in Kubernetes, ande I also got this error when I build the docker image at Jenkins slave: ERROR: Cannot run program "docker" (in directory "/home/jenkins/workspace/springboot"): error=2, No such file or directory.
Any solution on it?

@cyrille-leclerc

This comment has been minimized.

Copy link
Contributor

cyrille-leclerc commented Jan 14, 2018

@ndeloof

This comment has been minimized.

Copy link
Member

ndeloof commented Jan 15, 2018

need to install docker in this image.
simplest way is to include RUN curl -fsSL get.docker.com | bash
Note : this isn't docker-in-docker, just docker binaries will be available, including client and docker-compose.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment