2. Agengda
• Docker brings benefits on CI/CD process
• Coding: IDE with Docker
• Build with Docker
• Jenkins with Docker
– 1 Master x Slaves
– Masters x Slaves
3. Docker Provides
• Easy to prepare dev build environments
• No languages/libraries dependencies
• Build starts in seconds - more faster
• Increased robustness
• Simplified deployment on CI nodes
• Faster Rollback & Canary Release
• Easy to scale on CI nodes
• Well compatible with existing CI tools
5. Coding
• IDE with Docker
– Can run your code any where
If it runs on your laptop it will run on the integration
server too
– Don't have to bother about libraries, conflicts or
installing GCC, etc.
– Easy to build with different language packs or
libraries, etc.
6. Coding
• Requirements for IDE with Docker
– Dockerfile
• Syntax highlighting
• Autocomplete
• Syntax validation
– Compose yml file
• Define inter container relation as links and volumes
• Run multiple containers with one click
– IDE build system
• Run containers from the IDE with different language packs
or library requirement, etc.
– IDE runtime system
• Launch runtime environment inside the container for
further troubleshooting and testing
7.
8.
9.
10. Docker Plugin for IDE
• Doclipser
• Sublime Docker
• IntelliJ IDEA 14.1
• Eclipse JBossTools
• Visual Studio 2015 RCTools for Docker -
Preview extension
Summary Page: http://domeide.github.io/
11. Build
• Currently, we cannot meet the CI principles:
– Every commit (to baseline) should be built
– Keep the build fast
– Make it easy to get the latest deliverables
• Problems:
– [Dragged] Update dev build environment
– [Dragged/Fragile] Build the source files
– [Complicated] Get the latest/specified
deliverables
12. Build with Docker
• Easy to prepare dev build environments
• No languages/libraries dependencies
• Build starts in seconds - more faster
• Increased robustness
• Simplified deployment on CI nodes
• Faster Rollback & Canary Release
• Easy to scale on CI nodes
• Well compatible with existing CI tools
13. Example: Way of Building Docker
• Chicken and Egg
– build the latest docker binary in old version of docker container
• Dockerfile: provides the necessary dependencies and
environment to build
– COPY source files into Docker build image
• hack/make.sh: provides the build script for
– binary, cross, unit test, integration-cli-test, etc.
• Verify the new version via dind (docker-in-docker)
• Deliverables
– Docker Images
– Binary
• mounting host folder to the dev container
• Via `docker cp`
14. dind - build docker
# git clone https://github.com/docker/docker.git
# cd docker; docker build -t docker-dev .
# docker run --privileged --rm -ti docker-dev /bin/bash
root@383dd9ee7613:/go/src/github.com/docker/docker# hack/make.sh binary
---> Making bundle: binary (in bundles/1.8.0-dev/binary)
Building: bundles/1.8.0-dev/binary/docker-1.8.0-dev
Created binary: bundles/1.8.0-dev/binary/docker-1.8.0-dev
root@383dd9ee7613:/go/src/github.com/docker/docker# docker
bash: docker: command not found
… …
root@383dd9ee7613:/go/src/github.com/docker/docker# docker -dD
root@383dd9ee7613:/go/src/github.com/docker/docker# docker run hello-world