0

I have installed jenkins 2.99 on my ICP V2.1. I have configured a pipeline job to build docker images and push to the local repository in a jenkinsfile, But the docker command is not getting recognised. I am getting the error

docker build -t <tag> .
/<>/script.sh: docker: not found

If docker has to be installed separately, how do we install?

31piy
  • 23,323
  • 6
  • 47
  • 67
vidya
  • 79
  • 1
  • 3
  • 7
  • What have you tried to install it? – Jeffrey Jan 03 '18 at 06:04
  • I found that, iam able the run the docker command (job) only for the first time on jenkins (after it is installed on ICP2.1), later it fails to find the docker binary. The jenkins is configured to installed docker automatically at "Global tool configuration". The first time i can see the log says, "Building remotely on default-aaaaaaa" and the job is successful. But the next time on it says "Building in workspace ......" and the job fails on the docker command. – vidya Jan 12 '18 at 04:16

1 Answers1

0

Considering ICP (IBM Cloud Private) is an application platform for developing and managing on-premises, containerized applications, docker should be installed already.

Check, outside of Jenkins, that docker is recognized.

which docker

Then, in the Jenkins page displaying the Job result, check the Environment variable section, and see if the PATH would include the folder where docker is installed.

VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250
  • I can see the docker in my master and other nodes(linux). Where do i set the environment variable on my Jenkins UI. – vidya Jan 03 '18 at 06:39
  • First check the path as described in my answer, then we will address the configuration issue – VonC Jan 03 '18 at 06:41
  • The folder for docker is included in the PATH. – vidya Jan 03 '18 at 07:03
  • OK, do you see that same path in the Environment variable section of your job (noce the job is executed)? – VonC Jan 03 '18 at 07:06