Docker Toolbox and git on Windows

Docker on Windows with boot2docker was a first step, but it’s has few shortcomings (specially with file sharing between guest OS, virtual OS and container).

Furthermore, necessary tools for Docker were to be nstalled by us, and some tools was not compatible with Windows.

Docker Toolbox is new fresh start and give you all-in-one tool with everything that you need in few clic. Docker Toolbox is also available on Mac OS.

docker-toolbox

So, Docker Toolbox will install different software and tools necessary to give you a good first experience on Windows. Here is a description about each tools.

VirtualBox

First, Docker Toolbox will install VirtualBox. VirtualBox is an hypervisor used to create virtual machine.

Why I should use Docker Container technology if I still need virtualization tools? Docker is useless !!! No, it’s not useless, you still need virtualization because you are on Windows, but you just need to run only one virtual machine, and you will run dozens of containers on it. This solution is much more efficient thant running dozens of VM.

Docker Client for Windows

Docker is divided in two part : deamon and client. Both communicate with JSON request. Before, client command should be executed in Linux VM. With Docker Client for Windows, you can execute client docker command from Windows prompt.  All is configured to communicate with Docker deamon installed in Virtual maching Linux.

Docker Machine

Docker Machine is a provisionning tool usefull to create Docker Host everywhere. Docker Machine is used to create virtual maching on cloud provider like Amazon, Google and Azure. It’s also work with hypervisor like VirtualBox, VMware and also with solution like OpenStack.

In our case, docker-machine will run boot2docker in VirtualBox.

Docker compose

Docker compose is a great tool to run multiple container defined in YAML file with their configuration. With only one command, you will have multiple container from different docker image. Docker Compose replace multiple docker run command, and avoid errors. Docker Compose is a good start to version your configuration and your infrastructure (Insfrastructure As Code).

Kitematic

Kitematic is a GUI Tool proposed as an alternative to command line. First developped for Mac OS, solution was bought by Docker Inc and adapted for Windows.

docker-kinematic

Git MSYS-git UNIX tools

Who does not know Github? This is a huge community and a great tool to version and share any code. Github is main source to find docker images, dockerfiles, and example.

In order to help you to pull everything, Docker Toolbox install Git for Windows.

Be carrefull with carriage return

On Windows, end of line symbol is CRLF Carriage Return Line Feed (\r\n) while on Linux, end of line is LF, line feed (\n)

When you clone git project, Git MSYS-git on Windows replace all your Llinux Line Feed by Windows Carriage Return. Very usefull for programming language, it’s dangerous for Dockerfile and Docker

Docker Toolbox share c:\Users with Virtual Machine boot2docker. When you’re building a new image from Dockerfile retrieved with git, build operation are executed on Linux VM with files shared from Windows, and files may not have correct end of line.

If you have this kind of error, please check your git configuration.

/bin/bash:1: command not found: ^H

Docker Quick Start Terminal

Here is the best part, with this shortcut, you will have Docker command prompt. In less than a minute, you are ready to try Docker

docker-quick-start-windows

3 thoughts on “Docker Toolbox and git on Windows

Leave a Reply

Your email address will not be published. Required fields are marked *