I have a new Jenkins installation. I want to run my entire pipeline in a downloaded Docker container.
When I use the below Jenkinsfile, everything works (note: I have docker installed on the Jenkins host)
pipeline {
agent any
stages {
stage('Test') {
steps {
sh 'docker -v'
}
}
}
}
Everything works for the above example, see build run nr 13 in the screenshot below.
Then, I change the Jenkinsfile to the following:
pipeline {
agent {
docker { image 'node:7-alpine' }
}
stages {
stage('Test') {
steps {
sh 'node --version'
}
}
}
}
The idea is that the node:7-alpine image gets downloaded and that the next steps are executed inside that container. However the Docker images does not seem to get downloaded at all and the pipeline does not go to the 'Test' stage. See screenshot below, build nr 14
Edit 1:
Clarification: in build nr 14, the "Declarative: checkout SCM" step completes successfully (see below screenshot for the output of that first step), but it does not go to the next step.
Edit 2:
Console output shows the following error:
On the Jenkins host, I have added my user to the docker group and can execute commands like 'docker ps' and 'docker images'
Any ideas?