Jay Taylor's notes
back to listing indexjenkinsci/docker-workflow-plugin
[web search]
Original source (github.com)
Clipped on: 2016-03-07
Skip to content
| .. | |||
| JENKINS_HOME | Renaming Workflow to Pipeline | a month ago | |
| repo | Simplification: use 'mvn -Dmaven.repo.local=/m2repo ...' instead of c… | 2 months ago | |
| .dockerignore | Initial commit | 10 months ago | |
| Dockerfile_release | Demo updates. | 17 days ago | |
| Dockerfile_snapshot | Demo updates. | 17 days ago | |
| Makefile | Do not force run to rebuild first. | 6 months ago | |
| README.md | More renaming Workflow to Pipeline | a month ago | |
| docker-workflow-version.txt | Demo updates. | 17 days ago | |
| gen-security-data.sh | Initial commit | 10 months ago | |
| plugins.txt | Demo updates. | 17 days ago | |
| run-demo.sh | No need to explicitly pull images we are about to run; just causes un… | 6 months ago | |
| workflow-reg-proxy.conf | Initial commit | 10 months ago | |
| wrapdocker | Initial commit | 10 months ago |
README.md
Docker image for Docker Pipeline demo
This image contains a "Docker Pipeline" Job that demonstrates Jenkins Pipeline integration with Docker via CloudBees Docker Pipeline plugin.
normaldocker run --rm -p 8080:8080 -p 8081:8081 -p 8022:22 --add-host=docker.example.com:127.0.0.1 -ti --privileged jenkinsci/docker-workflow-demo
normal
The "Docker Pipeline" Job simply does the following:
- Gets the Spring Pet Clinic demonstration application code from GitHub.
- Builds the Pet Clinic application in a Docker container.
- Builds a runnable Pet Clinic application Docker image.
- Runs a Pet Clinic app container (from the Pet Clinic application Docker image) + a second maven3 container that runs automated tests against the Pet Clinic app container.
- The 2 containers are linked, allowing the test container to fire requests at the Pet Clinic app container.
The "Docker Pipeline" Job demonstrates how to use the docker DSL:
- Use
docker.imageto define a DSLImageobject (not to be confused withbuild) that can then be used to perform operations on a Docker image:- use
Image.insideto run a Docker container and execute commands in it. The build workspace is mounted as the working directory in the container. - use
Image.runto run a Docker container in detached mode, returning a DSLContainerobject that can be later used to stop the container (viaContainer.stop).
- use
- Use
docker.buildto build a Docker image from aDockerfile, returning a DSLImageobject that can then be used to perform operations on that image (as above).
The docker DSL supports some additional capabilities not shown in the "Docker Pipeline" Job:
- Use the
docker.withRegistryanddocker.withServerto register endpoints for the Docker registry and host to be used when executing docker commands.docker.withRegistry(<registryUrl>, <registryCredentialsId>)docker.withServer(<serverUri>, <serverCredentialsId>)
- Use the
Image.pullto pull Docker image layers into the Docker host cache. - Use the
Image.pushto push a Docker image to the associated Docker Registry. Seedocker.withRegistryabove.

