Docker on Windows is as easy as on Linux
Do you want to run Docker on Windows like this? See details below for instructions! ?
Docker on Windows has 2 versions:
- Docker for Windows requires Windows 10 OS to turn on Hyper-V (not all machines are supported and not stable)
- Docker Toolbox can be installed on any Windows OS based on VirtualBox (limited by VirtualBox's default settings).
To run Docker on Windows the easiest, you will usually install Docker Toolbox . However, installing and using Docker Toolbox on Windows will encounter a lot of problems:
- Not running the docker command in addition to Docker Quickstart Terminal is very inconvenient
- Save drive space C by default the Docker VM setting will be saved on drive C
- Limited to 20GB disk size due to Docker VM's default settings that lead to debris many Docker Images will eventually run out of disk space soon
- Operation of the docker command on Windows is not convenient due to the limitation of cmder on Windows.
To solve this problem, follow the instructions below:
1. Download the latest Docker ToolBox stable version
https://github.com/docker/toolbox/releases
- Install as usual
- Absolutely not run Docker Toolbox after installation is complete (so that it does not initialize itself with the default setting)
2. Set up environment variables:
1 2 3 4 5 | DOCKER_MACHINE_NAME = default MACHINE_STORAGE_PATH = D: data docker DOCKER_TLS_VERIFY = 1 DOCKER_HOST = tcp: //192.168.99.100: 2376 DOCKER_CERT_PATH = D: data docker |
Explain the above settings to help:
- Save Docker's data to another drive (here is drive D directory D: data docker)
- Environment variables help run docker commands in addition to Docker Quickstart Terminal
3. Create Docker Machine:
Create a folder to store data for Docker:
1 | D: data docker |
Go to CMD and type the following command to create Docker Machine:
1 | docker-machine create -d virtualbox - virtualbox-disk-size "100000" default |
Note: the above command will create disk-size ~ 100GB for ease of use (you can manually adjust this disk-size)
4. Run Docker Quickstart Terminal to start Docker VM
Search + Run:
1 | Start Menu> Docker Quickstart Terminal |
5. Install the most popular Cmder – Commander on Windows
This is no different commander Terminal on Linux, even more amazing:
- Very nice interface transparent window + Monokai theme with many colors makes it easy to see the commands
- Having Tab and dividing multiple Console boxes helps manage tracking easily
- Copy / insert with shortcut + right mouse button
- Support a lot of popular scripts of Linux CMD
1 | Download: http://cmder.net/ |
If you want to exchange more about Docker / DevOps / MicroService / Java, add Facebook yourself.