Boot2Docker for Windows

Contributor - 10 March 2015 - 12min
Contributor - 10 March 2015 - 12min
Development environment – It can take too long to set it up
Have you ever thought that how long does it take for an entry level developer to setup a new project development environment? The answer depends on many factors like the project age, the number of developers worked on it etc. but don’t get surprised if you get answer half a day or more.
Hey! It should be much faster than that: checkout a script and execute it. That’s all. Two steps should be sufficient to setup your environment and get ready for development.
Deployment environment – It can differ too much from testing and production environments
Have you ever skipped your build’s automated tests because they failed on your machine? Or even worst, have you ever been the cause of a build break even if your changes compiled smoothly on your machine but failed consistently on CI server?
Any slight difference can result in an unexpected behavior. Diverging can be as simple as giving a try to the last version of a framework or switching to a different project for half a day.
Finding out what makes your system behave differently is an annoying task every developer should avoid.
Welcome to the docker world!!!
What is Boot2Docker?
Boot2Docker is a lightweight Linux distribution based on Tiny Core Linux made specifically to run Docker containers. It runs completely from RAM, weighs ~27MB and boots in ~5s.
Why should we use Boot2Docker:
The Boot2Docker project smoothens the gap by bringing Docker to an otherwise incompatible platform. If you want to prepare a packageable and easily shippable program from a windows/mac environment you should use this. It allows you to run Linux containers through windows/mac.
To make this process easier, docker has designed a helper application called Boot2Docker that installs the virtual machine and runs the Docker daemon.
How would we do that?
Setup Boot2Docker on windows to run a tomcat instance:
Deploy a war to tomcat:
Publish an image to a private repo:
We will be using quay.io for our private repo hosting. All the docker images your team needs can be uploaded here, to be pulled on later. You will have to sign in. Use the link https://quay.io/signin/
In order to publish the image, follow the steps below:
References:
https://docs.docker.com/installation/windows/
https://github.com/boot2docker/boot2docker
"That's cool. Would love to use it.".