I am running Jenkins in Docker container but getting the below error while running a pipeline job. The below pipeline snippet checks if maven is being used or not, it throws below error message.
Installed Plugins are,
Docker plugin
Docker pipeline
Additionally, I also configured docker on Jenkins UI, under tools section. Can someone suggest over this ?
I know I’m replying very late. But if it helps someone then make use of this solution.
As mentioned in the official documentation, if you want to use Docker inside Jenkins, where Jenkins itself is being run as Docker container, then download Docker:dind image and run both Jenkins container and Docker:dind container on the same network.
Create network docker network create jenkins
Run docker:dind image’s container on the same network.
I know I’m replying very late. But if it helps someone then make use of this solution.
As mentioned in the official documentation, if you want to use Docker inside Jenkins, where Jenkins itself is being run as Docker container, then download Docker:dind image and run both Jenkins container and Docker:dind container on the same network.
For easing other users, instead of going to documentation and search for it, I’ve provided required commands here.
Create network docker network create jenkins
Run docker:dind image’s container on the same network.