Hope everyone are doing fine.
We are migrating from bamboo to Jenkins and finding some hurdles during this process.
We are trying to create agent which uses docker image and start building our job inside the container. PFB code snippet we used
In the above scenario we faced "docker command not found" error and changed to below snippet.
While when the above snippet is executed we are getting below error.
[2021-06-22T10:43:46.706Z] Running on main-0mzqv in /home/jenkins/agent/workspace/abcd/custom_image
[2021-06-22T10:43:46.711Z] [Pipeline] {
[2021-06-22T10:43:47.164Z] [Pipeline] withEnv
[2021-06-22T10:43:47.169Z] [Pipeline] {
[2021-06-22T10:43:47.204Z] [Pipeline] withDockerRegistry
[2021-06-22T10:43:47.636Z] $ docker login -u abcd -p ********
https://docker-url[2021-06-22T10:43:47.707Z] [Pipeline] // withDockerRegistry
[2021-06-22T10:43:47.739Z] [Pipeline] }
[2021-06-22T10:43:47.783Z] [Pipeline] // withEnv
[2021-06-22T10:43:47.800Z] [Pipeline] }
[2021-06-22T10:43:47.830Z] [Pipeline] // node
[2021-06-22T10:43:47.866Z] [Pipeline] End of Pipeline
[2021-06-22T10:43:55.117Z] java.io.IOException: error=2, No such file or directory
[2021-06-22T10:43:55.117Z] at java.lang.UNIXProcess.forkAndExec(Native Method)
[2021-06-22T10:43:55.117Z] at java.lang.UNIXProcess.<init>(UNIXProcess.java:247)
[2021-06-22T10:43:55.117Z] at java.lang.ProcessImpl.start(ProcessImpl.java:134)
[2021-06-22T10:43:55.117Z] at java.lang.ProcessBuilder.start(ProcessBuilder.java:1029)
[2021-06-22T10:43:55.117Z] Also: hudson.remoting.Channel$CallSiteStackTrace: Remote call to JNLP4-connect connection from.X.X.X:X
[2021-06-22T10:43:55.117Z] at hudson.remoting.Channel.attachCallSiteStackTrace(Channel.java:1800)
[2021-06-22T10:43:55.117Z] at hudson.remoting.UserRequest$ExceptionResponse.retrieve(UserRequest.java:356)
[2021-06-22T10:43:55.118Z] at hudson.remoting.Channel.call(Channel.java:1001)
[2021-06-22T10:43:55.118Z] at hudson.Launcher$RemoteLauncher.launch(Launcher.java:1121)
[2021-06-22T10:43:55.118Z] at hudson.Launcher$ProcStarter.start(Launcher.java:508)
[2021-06-22T10:43:55.118Z] at hudson.Launcher$ProcStarter.join(Launcher.java:519)
[2021-06-22T10:43:55.118Z] at org.jenkinsci.plugins.docker.commons.impl.RegistryKeyMaterialFactory.materialize(RegistryKeyMaterialFactory.java:101)
[2021-06-22T10:43:55.118Z] at org.jenkinsci.plugins.docker.workflow.AbstractEndpointStepExecution2.doStart(AbstractEndpointStepExecution2.java:53)
[2021-06-22T10:43:55.118Z] at org.jenkinsci.plugins.workflow.steps.GeneralNonBlockingStepExecution.lambda$run$0(GeneralNonBlockingStepExecution.java:77)
[2021-06-22T10:43:55.118Z] at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
[2021-06-22T10:43:55.118Z] at java.util.concurrent.FutureTask.run(FutureTask.java:266)
[2021-06-22T10:43:55.118Z] at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
[2021-06-22T10:43:55.118Z] at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
[2021-06-22T10:43:55.118Z] Caused: java.io.IOException: Cannot run program "docker": error=2, No such file or directory
[2021-06-22T10:43:55.118Z] at java.lang.ProcessBuilder.start(ProcessBuilder.java:1048)
[2021-06-22T10:43:55.118Z] at hudson.Proc$LocalProc.<init>(Proc.java:252)
[2021-06-22T10:43:55.118Z] at hudson.Proc$LocalProc.<init>(Proc.java:221)
[2021-06-22T10:43:55.118Z] at hudson.Launcher$LocalLauncher.launch(Launcher.java:996)
[2021-06-22T10:43:55.118Z] at hudson.Launcher$ProcStarter.start(Launcher.java:508)
[2021-06-22T10:43:55.118Z] at hudson.Launcher$RemoteLaunchCallable.call(Launcher.java:1390)
[2021-06-22T10:43:55.118Z] at hudson.Launcher$RemoteLaunchCallable.call(Launcher.java:1333)
[2021-06-22T10:43:55.118Z] at hudson.remoting.UserRequest.perform(UserRequest.java:211)
[2021-06-22T10:43:55.118Z] at hudson.remoting.UserRequest.perform(UserRequest.java:54)
[2021-06-22T10:43:55.118Z] at hudson.remoting.Request$2.run(Request.java:376)
[2021-06-22T10:43:55.118Z] at hudson.remoting.InterceptingExecutorService.lambda$wrap$0(InterceptingExecutorService.java:78)
[2021-06-22T10:43:55.118Z] at java.util.concurrent.FutureTask.run(FutureTask.java:266)
[2021-06-22T10:43:55.118Z] at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
[2021-06-22T10:43:55.118Z] at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
[2021-06-22T10:43:55.118Z] at hudson.remoting.Engine$1.lambda$newThread$0(Engine.java:119)
[2021-06-22T10:43:55.118Z] at java.lang.Thread.run(Thread.java:748)
[2021-06-22T10:43:55.118Z] Finished: FAILURE
Note: We do have very limited access in Jenkins, so most of our work will involve trying around in pipeline script.
Looking for solution.Please do let us know on what we are missing.