Child pages
  • CloudBees Docker Custom Build Environment Plugin

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Removed adopt-this-plugin label

Wiki Markup
{jenkins-plugin-info:pluginId=docker-custom-build-environment}
Excerpt

This plugin allows the definition of a build environment for a job using a Docker container.

...

Please note : this is your responsibility to get the docker cli executable in your container. Simplest option is to include those lines in your Dockerfile :

Code Block

RUN wget https://get.docker.io/builds/Linux/x86_64/docker-latest -O /bin/docker
RUN chmod +x /bin/docker

Within a build step in your job you can then run docker containers as you would from command line. If the container you're starting need to share files with the build, you can configure it to mount the same volumes used by your build container. Let's say for sample you have a docker image for application server which expect as launch parameter the path to your application WAR package. You can then run :

Code Block

docker run --volumes-form $BUILD_CONTAINER_ID application_server_docker_image $WORKSPACE/dist/myapp.war

...

plugin do expose BUILD_CONTAINER_ID variable during the build so you can make reference to the container hosting the build when needed.

Open JIRA issues

Jira Issues
anonymoustrue
urlhttps://issues.jenkins-ci.org/sr/jira.issueviews:searchrequest-xml/temp/SearchRequest.xml?jqlQuery=project+%3D+JENKINS+AND+status+in+%28Open%2C+%22In+Progress%22%2C+Reopened%29+AND+component+%3D+docker-custom-build-environment-plugin+ORDER+BY+issuetype+ASC%2C+priority+DESC%2C+key+ASC&tempMax=1000

Prerequisites

The slave executor(s) running jobs need to have docker installed and the daemon running. We suggest you use a "docker" label for such slaves, so you benefit from Jenkins slave management and cloud capabilities.

...

Versions

Not released yet

1.6.4

1.6.3

  • Fixed a regression introduced in 1.6.2, corrupting environment variables (JENKINS-31166)

1.6.2

  • Support bridge 'net' flag (commit)
  • Do not append command if not set (JENKINS-30692) (#33)
  • Added an option to force pull the image
  • Expose build wrappers contributed environment variables
  • Ensure docker0 is up before trying to resolve it

1.6.1

  • Use the Java API to lookup docker0 ip (JENKINS-30512) (#32)
  • Add buildwrapper environment variables to the docker context

1.6

  • support maven job type
  • expose dockerhost IP as "dockerhost" in /etc/host 
  • configure container with a subset of build environment, as slave node environment doesn't make sense inside container.

...