Containers are created but not used
See original GitHub issue- docker-plugin version 1.1.6
- Jenkins ver. 2.176.1
- Docker version 18.06.1-ce
I’m trying to run a simple git clone command inside a container (jenkins-ssh), which is on another host (slave host): pipeline { agent {label ‘slave1’} stages { stage(‘GetCode’) { steps { sh ‘git clone myrepo.git’ } …
The problem is that although container are created successfully, docker ps + docker logs. The jenkins UI shows the message that “Queued All nodes of label ‘slave1’ are offline”.
Jenkins logs are showing the following:
INFO: Trying to run container for node slave1-0007qgo2yrd6u from image: jenkins/ssh-slave
Jul 03, 2019 1:39:18 PM com.nirima.jenkins.plugins.docker.DockerTemplate doProvisionNode
INFO: Started container ID 42bac5ecbe3e6b81bfc25822d62a542628745c602198e80ef7fdbe68bfdc95b0 for node slave1-0007qgo2yrd6u from image: jenkins/ssh-slave
Jul 03, 2019 1:39:19 PM com.nirima.jenkins.plugins.docker.utils.PortUtils$ConnectionCheckSSH execute
INFO: SSH port is open on 192.168.1.18:32846
Jul 03, 2019 1:39:27 PM hudson.slaves.NodeProvisioner$2 run
INFO: Image of jenkins/ssh-slave provisioning successfully completed. We have now 31 computer(s)
Jul 03, 2019 1:39:27 PM com.nirima.jenkins.plugins.docker.DockerCloud provision
INFO: Asked to provision 1 slave(s) for: slave1
Jul 03, 2019 1:39:27 PM com.nirima.jenkins.plugins.docker.DockerCloud canAddProvisionedSlave
INFO: Provisioning 'jenkins/ssh-slave' on 'docker'; Total containers: 30 (of 100)
Jul 03, 2019 1:39:27 PM com.nirima.jenkins.plugins.docker.DockerCloud provision
INFO: Will provision 'jenkins/ssh-slave', for label: 'slave1', in cloud: 'docker'
Jul 03, 2019 1:39:27 PM hudson.slaves.NodeProvisioner$StandardStrategyImpl apply
INFO: Started provisioning Image of jenkins/ssh-slave from docker with 1 executors. Remaining excess workload: 0
Jul 03, 2019 1:39:27 PM com.nirima.jenkins.plugins.docker.DockerTemplate pullImage
INFO: Pulling image 'jenkins/ssh-slave:latest'. This may take awhile...
Jul 03, 2019 1:39:28 PM com.nirima.jenkins.plugins.docker.DockerTemplate pullImage
INFO: Finished pulling image 'jenkins/ssh-slave:latest', took 1115 ms
Jul 03, 2019 1:39:28 PM com.nirima.jenkins.plugins.docker.DockerTemplate doProvisionNode
INFO: Trying to run container for jenkins/ssh-slave
Jul 03, 2019 1:39:28 PM com.nirima.jenkins.plugins.docker.DockerTemplate doProvisionNode
INFO: Trying to run container for node slave1-0007qgsnyzliy from image: jenkins/ssh-slave
Jul 03, 2019 1:39:28 PM com.nirima.jenkins.plugins.docker.DockerTemplate doProvisionNode
INFO: Started container ID 5a3f082985eac8305334389600bf64ca7413816ee5bc16b3707ba8cc9d11a59c for node slave1-0007qgsnyzliy from image: jenkins/ssh-slave
So basically, containers are provisioned but nothing is executed inside them.
Issue Analytics
- State:
- Created 4 years ago
- Comments:12 (6 by maintainers)
Top Results From Across the Web
Why Does My Docker Container Stop? - Tutorial Works
Containers aren't usually used like general-purpose virtual machines. They are designed to run, or contain, a single application. This allows them to start...
Read more >Docker - Container is not running - Stack Overflow
@ApexFred, Docker containers are not like VMs; they are designed to run an application. When the application terminates, so does the container.
Read more >How to Fix and Debug Docker Containers Like a Superhero
Container errors are tricky to diagnose, but some investigative magic works wonders. Read along to learn how to debug Docker containers.
Read more >7 Cases When You Should Not Use Docker - freeCodeCamp
Do Not Use Docker if You Need to Boost Speed. Docker containers are smaller and require fewer resources than a virtual machine with...
Read more >Docker image versus container: What are the differences?
Images themselves do not run, but you can create and run containers from a Docker image. What is a container? A container is...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

Yup, that’s the way the SSH-Inject method works. No further steps required.
However, you will need to ensure that the filesystem location into which the plugin puts the key is the same location that the SSH service will be looking for one, and that the ownership etc is correct etc, otherwise the SSH service won’t let Jenkins log in.
Re: “Amazon Linux” Another “hard won” lesson I learned is that you have to be careful when mixing different Javas. I found that Oracle & OpenJDK weren’t fussy - as long as the major versions were the same, you could have any Oracle running master & any OpenJDK on the slaves, or the other way around but I found that if I was using the IBM Java I had to ensure that I used exactly the same version (including patches etc) everywhere. I’ve never used/tried Amazon Linux but I would suggest that you use OpenJDK 8 (or higher) everywhere as that’s what Jenkins is built, tested & supported on.