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 in Jenkins by Kim
54 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 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 in Jenkins by Bishu
592 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 in Jenkins by Bishu
186 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
• 9,530 points
367 views
0 votes
1 answer
0 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
• 56,520 points
151 views
0 votes
5 answers