Jenkins Builds docker Mirror

  docker, jenkins

Installing dock-related plugin

System Management-Plug-in Management-Optional Plug-in

  • Docker plugin

  • Docker Slaves Plugin

  • docker-build-step

Configure docker Plug-ins

Build docker-http-proxy

Expose docker’s api in http

docker run --rm \
    -p 2375:2375 \
    --name shipyard-proxy \
    -v /var/run/docker.sock:/var/run/docker.sock \
    -e PORT=2375 \

Building jenkins-slave image

You can refer todind-jenkins-slaveSelf-defining

Configure cloud

System Management-System Settings-Cloud-New Cloud


  • docker url
    Here is tcp://, the port here is the port of the above docker-http-proxy agent, and the ip is the address of docker-machine

You can test through test connection.

  • Add template

The image here is the docker image of jenkins-slave.
Labels here are marked as docker-agent, that is, the name of node for this jenkins slave.
The Credentials of Launch method here are jenkins/jenkins.

Configure job

Select node


Docker-maven-plugin is not used here, but a mirror image is built directly in the shell according to Dockerfile.