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

  • update git version in docker container
  • Updating docker-compose Ubuntu 15.10
  • Play 2.5.x in Docker container not updating through shared folder
  • Why do kubelet failed to get stats from docker (error 500)?
  • boot2docker command works on shell, but not in script
  • Docker: wget for https does not work
  • Thanks in Advance

  • Docker cannot run
  • xdebug only gets triggered via running script from cli and not browser
  • pre-cache node_modules in Docker container
  • sbt-native-packager docker: How to add entry in /etc/hosts
  • Docker External File Access Not in /Users/ on OSX
  • Kubernetes & insecure docker registries
  • 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.