IBM Global Business Services
Michael Wellner
Application Development & Innovation
December 2015
Development-Environment Up & Running
Use Docker to specify and reuse your project’s dev environment
Reduce efforts to build and maintain
consistent development environments
Managing development environments of project’s developers is often hard and time expensive, the
main reasons for this are:
• A developer handbook containing the environment setup (sometimes with several variations for
different OSs) needs to be maintained.
• Every developer needs to install and configure several tools like JDK, Git, SBT, Maven, Gulp,
NPM, etc..
• However, due to different developer machines (Windows, Mac, Linux, …), the tools are not
working equally on each machine (e.g. file-system hooks for watch-processes, different JDK
behaviour between operating systems).
• Developers are not continuously updating their environment when the handbook is updated.
• The handbook even may not be maintained to be up to date.
This costs a lot of time throughout a project and often leads to strange problems (at the first sight)
due to different environments.
To face these problems one could provide a virtual machine which contains a consistent
development environment for everybody. While this will resolve all of the above mentioned problems
it also has tradeoffs like high memory requirements. A much more light-weight solution can be
realised through the usage of docker. The following slides will explain this approach in more detail.
2
Create a Docker container with all
necessary tools and configurations
All necessary tools and
configurations are defined in a
Dockerfile which can be managed
within your VCS and also
documents all necessary tools
and configurations. Thus there is
no need for extra documentation
on how to set up all tools and the
environment.
A detailed example can be found
on GitHub.
3
Configurations
… all tools 

you need
The container can be run on all different
kinds of developer machines
• Docker runs natively on Linux machines and via a light-weight Virtual Machine in the
background on Windows and Mac OS Machines (6s startup time, almost no performance
footprint, for more details see Docker Toolbox).
• A local volume can be mounted to allow the developer to work with natively running IDEs.
(The IDE and its configuration may also be provided by the Docker container).
4
DOCKER_HOST Linux
Docker daemon
Docker client
Development container
Workspace data
DOCKER_HOST Linux
Docker daemon
Development container
Workspace data
Windows/ Mac OS
Docker client
Using a virtual machine instead is much
more expensive
• Large VM size
• Everybody needs the same virtualisation software (potential extra
license costs)
• Memory Usage on development host
• The installation and configuration is not documented by nature, a
handbook still needs to be created and maintained
5
We aren’t living in a perfect world - There
are challenges realising the approach
Challenges which may arise in a real world project:
• SOLVED. Running the same container behind a cooperate proxy
with username/ password and in home office, without the proxy
• SOLVED. On Linux hosts files created by the development container
may not be accessible by the host due to user rights
• SOLVED. On MacOS shared volumes are working very slow within
Docker Machine due to issues with vboxsf.
6
Thinking a few steps further …
The application may be shipped as container.



In that case the deliverable as well as the development container
are sharing the same base container.
The build server is also a docker container itself.



In that case the deliverable as well as the build container are
sharing the same base container, like in this Example: base-dev,
dev, build.
Eclipse Che, the Next-Generation Eclipse IDE, is using a similar
approach.
7
Definitions
The development environment is a system including all necessary
tools (VCS client, IDE, build tools, …) and configurations to develop,
build and test (developer test) a software project.
A developer machine is a computer with an arbitrary operating
system which is used by the developer to develop, build and test a
software project.
8

Development-Environment Up & Running with Docker

  • 1.
    IBM Global BusinessServices Michael Wellner Application Development & Innovation December 2015 Development-Environment Up & Running Use Docker to specify and reuse your project’s dev environment
  • 2.
    Reduce efforts tobuild and maintain consistent development environments Managing development environments of project’s developers is often hard and time expensive, the main reasons for this are: • A developer handbook containing the environment setup (sometimes with several variations for different OSs) needs to be maintained. • Every developer needs to install and configure several tools like JDK, Git, SBT, Maven, Gulp, NPM, etc.. • However, due to different developer machines (Windows, Mac, Linux, …), the tools are not working equally on each machine (e.g. file-system hooks for watch-processes, different JDK behaviour between operating systems). • Developers are not continuously updating their environment when the handbook is updated. • The handbook even may not be maintained to be up to date. This costs a lot of time throughout a project and often leads to strange problems (at the first sight) due to different environments. To face these problems one could provide a virtual machine which contains a consistent development environment for everybody. While this will resolve all of the above mentioned problems it also has tradeoffs like high memory requirements. A much more light-weight solution can be realised through the usage of docker. The following slides will explain this approach in more detail. 2
  • 3.
    Create a Dockercontainer with all necessary tools and configurations All necessary tools and configurations are defined in a Dockerfile which can be managed within your VCS and also documents all necessary tools and configurations. Thus there is no need for extra documentation on how to set up all tools and the environment. A detailed example can be found on GitHub. 3 Configurations … all tools you need
  • 4.
    The container canbe run on all different kinds of developer machines • Docker runs natively on Linux machines and via a light-weight Virtual Machine in the background on Windows and Mac OS Machines (6s startup time, almost no performance footprint, for more details see Docker Toolbox). • A local volume can be mounted to allow the developer to work with natively running IDEs. (The IDE and its configuration may also be provided by the Docker container). 4 DOCKER_HOST Linux Docker daemon Docker client Development container Workspace data DOCKER_HOST Linux Docker daemon Development container Workspace data Windows/ Mac OS Docker client
  • 5.
    Using a virtualmachine instead is much more expensive • Large VM size • Everybody needs the same virtualisation software (potential extra license costs) • Memory Usage on development host • The installation and configuration is not documented by nature, a handbook still needs to be created and maintained 5
  • 6.
    We aren’t livingin a perfect world - There are challenges realising the approach Challenges which may arise in a real world project: • SOLVED. Running the same container behind a cooperate proxy with username/ password and in home office, without the proxy • SOLVED. On Linux hosts files created by the development container may not be accessible by the host due to user rights • SOLVED. On MacOS shared volumes are working very slow within Docker Machine due to issues with vboxsf. 6
  • 7.
    Thinking a fewsteps further … The application may be shipped as container.
 
 In that case the deliverable as well as the development container are sharing the same base container. The build server is also a docker container itself.
 
 In that case the deliverable as well as the build container are sharing the same base container, like in this Example: base-dev, dev, build. Eclipse Che, the Next-Generation Eclipse IDE, is using a similar approach. 7
  • 8.
    Definitions The development environmentis a system including all necessary tools (VCS client, IDE, build tools, …) and configurations to develop, build and test (developer test) a software project. A developer machine is a computer with an arbitrary operating system which is used by the developer to develop, build and test a software project. 8