The goal:
- preparation of a basic set of tools for working with containers based on Virtual Box, Docker Toolbox and GIT Bash command line
- Use this procedure if you have Windows, but for some reason you can't install Docker Desktop.
You need:
- A computer running Windows 7 or 10
- Activated virtualization support in BIOS
You will prepare everything you need to start working with application containers.
The applications will run on the VirtualBox, which you install using the docker-machine
utility.
The work will take place on the command line GIT BASH
. You will work with containers using the docker
client, which communicates with thedocker-machine
virtual machine. You will install everything you need using the "Docker Toolbox" installer.
The result will look something like this:
+----------------+ +----------------+
| docker-machine | | Docker Engine |
| docker CLI | <--connection----> | on VirtualBox |
+----------------+ via virtual network +----------------+
^ ^
| |
Git Bash on Windows VirtualBox Monitor
Installing the Docker Toolbox
The Docker Toolbox installs everything you need to work with Docker. Docker Toolbox can also be used on OS X and Windows 7.
You can get the Docker Toolbox from GitHub.
- VirtualBox provides an environment for running various virtual machines. After installation, don't forget to run the program.
- Docker Machine creates a Virtual Box that contains an environment for running Docker containers.
- Docker client for working from the command line
- Git Bash
Git Bash Provides a basic set of Unix tools for Windows
bash
: command line and scripting toolgit
: project management, submission of assignmentsvim
: Your favorite text editorssh
: remote connectionscp
: copy filescurl
: retrieve files from the webgcc
: compiler
If you want to install Git Bash separately, you can get it from the website. You can follow the installation instructions instructions.
Installing the Docker Engine using docker-machine
After installing Docker Toolbox, you should have the docker-machine
anddocker
commands available on the GIT Bash command line.
Launch the "GIT Bash" application. You can verify that "Docker Machine" works with the command:
docker machine
If you have done so correctly, you will see the docker-machine
help. See what can be done.
Creating a virtual machine
The Docker Toolbox installer should be able to create a virtual machine for you. If not, use the command line to create.
To create a new virtual machine called default
on VirtualBox, use the command (it takes a while):
docker-machine create --driver virtualbox default
You can check the list and status of existing Docker virtual machines using the commands:
docker-machine ls
docker-machine status default
To connect to a running virtual machine, use the command:
docker-machine ssh default
If all goes well, the docker
command should communicate with the running Docker Engine virtual machine.
Try the command:
docker version
If the Docker line client cannot connect to the remote Docker Engine, you can try this tutorial.
The client should make it easier for you to connect:
docker-machine env