Run "gradle docker" for spring boot, on Jenkins


When I run “gradle docker” for a spring boot project locally, it works fine, and the image is built.

However, When I ran on “gradle docker” on jenkins, the Error message is:

Caused by: Cannot run program “docker” (in directory “/var/lib/jenkins/workspace/maskdemo_pipeline_master/build/docker”): error=2, No such file or directory
at net.rubygrapefruit.platform.internal.DefaultProcessLauncher.start(
… 7 more
Caused by: error=2, No such file or directory
… 8 more
Anyone have any idea what cause this issue? Thank you


  • install docker on EC2 instance
  • give jenkins permission to run docker