Provisioning Docker Containers on a Remote Host Using Jenkins Master

I have Docker Engine installed on an Ubuntu 14.04 LTS Server. I have activated the Docker API as well by making some changes to the config files and I am able to access the APIs.

I have jenkins installed on another Ubuntu 14.04 server.

Can somebody please help me with the steps to build/run images on the remote docker server with the help if Jenkins.
I am not able to find any proper steps or plugin present in Jenkins to run the Docker commands remotely.

Hi there.

We have a similar need, but are facing a slightly different problem. We have a Jenkins master at one site, with a local docker cloud attached, using the docker plugin. This is able to schedule jobs on the host, and attach to the containers over the docker network (172.x.y.z). We have configured these containers to run and SSH daemon, so jenkins slaves enter via the usual SSH mechanism.

This is one option that you can use.

However as I said, we have a different issue which maybe you can provide some input to - we have a remote site which exposes a docker API. We ca connect via Jenkins to the API, and containers get launched, but we cannot enter them from the jenkins server to start the slave because they have private IP addresses, which are not accessible to the remote master.

I think the only way to enter them is to expose the ssh service over a series of different ports.

Any suggestions ?