-
Bug
-
Resolution: Fixed
-
Major
-
None
the ssh-agent configuration isn't applied when pipeline is run on a docker container using the kubernetes plugin
as an example, this pipeline works fine:
node { stage('Pre-Build') { sshagent (credentials: ['jenkins-master-ssh']) { sh 'ssh -vT -o "StrictHostKeyChecking=no" git@github.com' } } }
the job will fail, but the console output will clearly show the error from github
You've successfully authenticated, but GitHub does not provide shell access.
whereas
podTemplate(label: 'jenkpod', containers: [containerTemplate(name: 'golang', image: 'golang:1.8', ttyEnabled: true, command: 'cat')]) { node ('jenkpod') { container('golang') { stage('Pre-Build') { sshagent (credentials: ['jenkins-master-ssh']) { sh 'ssh -vT -o "StrictHostKeyChecking=no" git@github.com' } } } } }
fails with public key error:
debug1: Authentications that can continue: publickey
debug1: Next authentication method: publickey
debug1: Trying private key: /root/.ssh/id_rsa
debug1: Trying private key: /root/.ssh/id_dsa
debug1: Trying private key: /root/.ssh/id_ecdsa
debug1: Trying private key: /root/.ssh/id_ed25519
debug1: No more authentication methods to try.
Permission denied (publickey).
this seems closely related to -JENKINS-32624sshagent{} ignored when executed in docker.image().inside
- duplicates
-
JENKINS-49370 Environment variables cannot be set within the container step
- Resolved
- is blocked by
-
JENKINS-47225 Kubernetes plugin not using cmd proc variables
- Resolved
- is related to
-
JENKINS-32624 sshagent{} ignored when executed in docker.image().inside{...}
- Resolved
-
JENKINS-40647 With Env not working after .10 k8 plugin update
- Resolved
-
JENKINS-42851 secretVolume not created read only
- Resolved
-
JENKINS-50437 Environment variables using PATH+SOMETHING syntax clear the previous env var
- Resolved
- links to