A basic example of what I want to do with my Jenkins file:
node {
sh 'docker build -t foo/bar .'
}
It seems I need to install dockers on the slave Jenkins image that my Jenkinsfile is executing. Is there an easy way to do this? (This slave Jenkins image is itself a docker container)
Are my assumptions correct?
- When working with a Jenkins master / slave, the Jenkins file is executed by a Jenkins subordinate
- Jenkins plugins installed through the "Manage plugins" section (for example, Docker Plugin or Gcloud SDK plugin) are installed only on Jenkins wizards, so will I need to manually create an image of Jenkins dockers and install dockers on the image?
Since I also need access to the gcloud command (I run Jenkins through Kubernetes Helm / Charts), I used the image gcr.io/cloud-solutions-images/jenkins-k8s-slavefor my Jenkins subordinate.
He is currently mistaken in saying "docker: not found"
source
share