'docker: not found' Error when building a docker image

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

'docker: not found' Error when building a docker image

Desmond Lim
Hi All,

I am trying to build a docker image inside a Jenkins pod.  However, I got the below errors.  When I login to the Jenkins pod, I cannot find the docker command.  I have installed all plugins related to Jenkins and am using 'jenkins/jenkins:lts' image from docker hub.  

[docker-demo] $ /bin/sh -xe /tmp/jenkins2842149568243187838.sh + docker build . -t anandr72/nodeapp /tmp/jenkins2842149568243187838.sh: 2: /tmp/jenkins2842149568243187838.sh: docker: not found Build step 'Execute shell' marked build as failure Finished: FAILURE

Appreciate if someone can help.  Thanks.  

--
You received this message because you are subscribed to the Google Groups "Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-users/31b7fa45-4b80-43b6-a83b-0d4c1417e010n%40googlegroups.com.
Reply | Threaded
Open this post in threaded view
|

Re: 'docker: not found' Error when building a docker image

Mark Waite-2
https://dev.to/thakkaryash94/how-many-ways-to-build-a-container-image-4g3p suggests several different ways that a Kubernetes pod can be used to build a container with using the docker command.

It also provides a nice summary of the risks of using the docker command to build untrusted images.

On Sat, Feb 6, 2021 at 11:44 AM Desmond Lim <[hidden email]> wrote:
Hi All,

I am trying to build a docker image inside a Jenkins pod.  However, I got the below errors.  When I login to the Jenkins pod, I cannot find the docker command.  I have installed all plugins related to Jenkins and am using 'jenkins/jenkins:lts' image from docker hub.  

[docker-demo] $ /bin/sh -xe /tmp/jenkins2842149568243187838.sh + docker build . -t anandr72/nodeapp /tmp/jenkins2842149568243187838.sh: 2: /tmp/jenkins2842149568243187838.sh: docker: not found Build step 'Execute shell' marked build as failure Finished: FAILURE

Appreciate if someone can help.  Thanks.  

--
You received this message because you are subscribed to the Google Groups "Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-users/31b7fa45-4b80-43b6-a83b-0d4c1417e010n%40googlegroups.com.

--
You received this message because you are subscribed to the Google Groups "Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-users/CAO49JtGXqdOzsRAnehrbGf%2BUzjpLam2zb16p7_KQcYTbBVPn%3DQ%40mail.gmail.com.
Reply | Threaded
Open this post in threaded view
|

Re: 'docker: not found' Error when building a docker image

Desmond Lim
Hi Mark,

Thanks for the responds.  However, I cannot find any Jenkins plugins for the solutions proposed in the link. 
Apologizes as I am a newbie in DevOps.  

I am thinking either to use a Jenkin's free style project or Pipeline to build a image and then push the image to docker hub.  In this case, the tool to build the images must either reside within the Jenkins pod or needs to be installed in another pod(I am looking at Kaniko/Podman) .  Is this understanding correct?

Thanks.  


On Sun, 7 Feb 2021 at 05:26, Mark Waite <[hidden email]> wrote:
https://dev.to/thakkaryash94/how-many-ways-to-build-a-container-image-4g3p suggests several different ways that a Kubernetes pod can be used to build a container with using the docker command.

It also provides a nice summary of the risks of using the docker command to build untrusted images.

On Sat, Feb 6, 2021 at 11:44 AM Desmond Lim <[hidden email]> wrote:
Hi All,

I am trying to build a docker image inside a Jenkins pod.  However, I got the below errors.  When I login to the Jenkins pod, I cannot find the docker command.  I have installed all plugins related to Jenkins and am using 'jenkins/jenkins:lts' image from docker hub.  

[docker-demo] $ /bin/sh -xe /tmp/jenkins2842149568243187838.sh + docker build . -t anandr72/nodeapp /tmp/jenkins2842149568243187838.sh: 2: /tmp/jenkins2842149568243187838.sh: docker: not found Build step 'Execute shell' marked build as failure Finished: FAILURE

Appreciate if someone can help.  Thanks.  

--
You received this message because you are subscribed to the Google Groups "Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-users/31b7fa45-4b80-43b6-a83b-0d4c1417e010n%40googlegroups.com.

--
You received this message because you are subscribed to the Google Groups "Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-users/CAO49JtGXqdOzsRAnehrbGf%2BUzjpLam2zb16p7_KQcYTbBVPn%3DQ%40mail.gmail.com.


--
Best Regards,
Desmond Lim

--
You received this message because you are subscribed to the Google Groups "Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-users/CAHFSeQzpu0TwWondYmp0LKwr9BD8UePgMerGZVsmCg4hSiwgLg%40mail.gmail.com.
Reply | Threaded
Open this post in threaded view
|

Re: 'docker: not found' Error when building a docker image

Mark Waite-2


On Saturday, February 6, 2021 at 11:11:19 PM UTC-7 dke wrote:
Hi Mark,

Thanks for the responds.  However, I cannot find any Jenkins plugins for the solutions proposed in the link. 
Apologizes as I am a newbie in DevOps.  

I am thinking either to use a Jenkin's free style project or Pipeline to build a image and then push the image to docker hub.  In this case, the tool to build the images must either reside within the Jenkins pod or needs to be installed in another pod(I am looking at Kaniko/Podman) .  Is this understanding correct?

Yes, your understanding is correct.  The tool to build the image will need to be available on the agent where the build is run.

The general direction in Jenkins projects is to prefer a Pipeline project rather than a Freestyle project so that you can control the job definition from source code rather than controlling the job definition from the Jenkins user interface.  If you use a Pipeline project, you avoid the need for a plugin to invoke the container builder for you.  You invoke the container builder from the `sh` step.

Mark Waite
 

Thanks.  


On Sun, 7 Feb 2021 at 05:26, Mark Waite wrote:
https://dev.to/thakkaryash94/how-many-ways-to-build-a-container-image-4g3p suggests several different ways that a Kubernetes pod can be used to build a container with using the docker command.

It also provides a nice summary of the risks of using the docker command to build untrusted images.

On Sat, Feb 6, 2021 at 11:44 AM Desmond Lim wrote:
Hi All,

I am trying to build a docker image inside a Jenkins pod.  However, I got the below errors.  When I login to the Jenkins pod, I cannot find the docker command.  I have installed all plugins related to Jenkins and am using 'jenkins/jenkins:lts' image from docker hub.  

[docker-demo] $ /bin/sh -xe /tmp/jenkins2842149568243187838.sh + docker build . -t anandr72/nodeapp /tmp/jenkins2842149568243187838.sh: 2: /tmp/jenkins2842149568243187838.sh: docker: not found Build step 'Execute shell' marked build as failure Finished: FAILURE

Appreciate if someone can help.  Thanks.  


--
Best Regards,
Desmond Lim

--
You received this message because you are subscribed to the Google Groups "Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-users/8f1eb779-9f69-44a0-9e2a-ac2b33ab3f02n%40googlegroups.com.