SSH key forwarding into docker container pipeline

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

SSH key forwarding into docker container pipeline

Lorem Ipsum
Hello

I'm trying to build a project which Makefile pulls modules from a private repository. How should I forward the SSH key from Jenkins to the docker container?

The pipeline which creates the build is pretty very basic but it fails on checkout: 

pipeline {
    agent
{ dockerfile true }
    stages
{
        stage
('Build'){
            steps
{
                sh
'make'
           
}
       
}
   
}
}

I assume that similar problem will occur for known_hosts entry for the git repo. Are there any best practices for this? 

--
You received this message because you are subscribed to the Google Groups "Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-users/8e3fc387-fabb-4118-a7b6-922d6539bba2%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: SSH key forwarding into docker container pipeline

Lorem Ipsum
I've tried modifying the Jenkinsfile to the following: 


pipeline {
    agent
{ dockerfile true }
    stages
{
        stage
('Build'){
            steps
{
                sshagent
(['d288a45e-5b02-4aac-839b-d87cc3a854d0']) {
                    sh
'make debian'
               
}
           
}
       
}
   
}
}

But the checkout fails with the following error:

No user exists for uid 112
fatal
: Could not read from remote repository.

Should I specially prepare the docker for Jenkins to use?

--
You received this message because you are subscribed to the Google Groups "Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-users/b0a21de4-ba58-49d2-8b10-61bc77d332f5%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: SSH key forwarding into docker container pipeline

Lorem Ipsum
In reply to this post by Lorem Ipsum
I've tried modifying the Jenkinsfile to the following: 


pipeline {
    agent 
{ dockerfile true }
    stages 
{
        stage
('Build'){
            steps 
{
                sshagent
(['d288a45e-5b02-4aac-839b-d87cc3a854d0']) {
                    sh 
'make'
                
}
            
}
        
}
    
}
}

But the checkout fails with the following error:

No user exists for uid 112
fatal
: Could not read from remote repository.

Should I specially prepare the docker for Jenkins to use?

--
You received this message because you are subscribed to the Google Groups "Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-users/d8427d71-f7ad-41bb-ad18-918b38fd5575%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.