Jenkins shell script execution on different server

I have two VM, on one VM I have docker and on another I have Jenkins .I have shell script for running docker, which is placed on server which have docker on it. But I need Jenkins to execute this shell script, from pre-build step.

I am facing problem with this process.
It will be very helpful if any one can provide the detail steps

  • How to create a new Mongodb in a Docker container upon startup?
  • Forward container port set by external service at runtime
  • docker like “links” on Kubernetes
  • How to resolve SG Client's ENOTFOUND error
  • How to ensure that web app in a container successfully bound to a port?
  • Docker - orchardup/mysql container does not start on Ubuntu 14.04
  • Thanks in Advance

  • Docker exposed ports are not available
  • Errors while running docker “Error resolving syscall name <>: could not resolve name to syscall - ignoring syscall.”
  • Specify nodeport when creating deployment in Minikube
  • How to create a virtual cluster using docker on a single node?
  • docker: npm install on docker start
  • MongoDB & Docker: connections from Dockerized Mongo client to external server refused
  • 2 Solutions collect form web for “Jenkins shell script execution on different server”

    There are different approaches to achieve that.

    One is to install Jenkins slave on the VM which has docker on and have your Jenkins master run the whole job on the slave.

    Or you could install one of Publish Over SSH Plugin or SSH plugin to execute commands remotely (if your docker VM has SSH access)

    If your network is sufficiently secured from the outside, you could expose the docker API socket via a TCP port on your docker-machine and run the docker commands from your jenkins machine, using the remote tcp-port.

    Basic idea is outlined here in the section “Bind Docker to another host/port or a Unix socket”

    Cheers D

    Docker will be the best open platform for developers and sysadmins to build, ship, and run distributed applications.