I want to connect to another docker daemon from within a docker container but it's not working from within jenkins.
The error I get is:
[restart_portal] Running shell script
Error response from daemon: No such container: 5a0fce9025ba1d047d8da9718ab830222d3fdc9f2a38773efd1e9d117f7e1e79
Is there a workaround for this?
Here is a simple example:
scripted:
docker.image('myimage').inside {
sh 'docker ps'
}
}
declarative:
pipeline {
agent {
dockerfile {
filename "jenkinsfiles/restart_portal/Dockerfile.aws"
label "restart"
}
stages {
stage('connect to docker host') {
}
steps {
script {
sh "docker ps"
}
}
}
}
}
}