Docker Pipeline plugin communicate with non-default docker server

0 votes
By default, the docker pipeline plugin communicates with the local docker daemon. How do i make it communicate with a non-default docker server, something like Docker Swarm?
Apr 12, 2019 in Jenkins by Kim
705 views

1 answer to this question.

0 votes

Hi @Kim, yes you can. You can use the withServer() function for this. Use it in a similar manner

node {
    checkout scm


    docker.withServer('tcp://swarm.example.com:2376', 'swarm-certs') {
        docker.image('mysql:5').withRun('-p 3306:3306') {
            /* do things */
        }
    }
}
answered Apr 12, 2019 by Shruti

Related Questions In Jenkins

0 votes
1 answer

Use a docker image with jenkins declarative pipeline

Hey @Jithin, you could use something like ...READ MORE

answered Apr 12, 2019 in Jenkins by Bishu
3,665 views
0 votes
1 answer

Use Custom Docker registry with jenkins declarative pipeline

Yes, you can! try something like this: node ...READ MORE

answered Apr 12, 2019 in Jenkins by Bishu
1,201 views
0 votes
1 answer

How to deploy the war file in Tomcat Server with Jenkins pipeline job on an windows machine?

Use deploy to container plugin. Go to the ...READ MORE

answered Sep 30, 2020 in Jenkins by Adil Abdullah Khan
1,929 views
0 votes
1 answer

Jenkins: Build Pipeline Plugin Scheduled Trigger

This can be done by setting the ...READ MORE

answered Jul 10, 2018 in Jenkins by Sophie may
• 10,550 points
3,138 views
+2 votes
1 answer
+2 votes
1 answer

Deploy Docker Containers from Docker Cloud

To solve this problem, I followed advice ...READ MORE

answered Sep 3, 2018 in AWS by Priyaj
• 58,120 points
1,197 views
0 votes
5 answers
0 votes
2 answers