Boot2docker installation under Windows

Time:2021-10-27

1、 Before starting

Boot2docker is an early docker client tool under windows. It can run without your Windows supporting hyper-v. Compared with docker for windows, boot2docker is a lightweight docker client tool.

Docker can be described as an artifact. Using it to configure the environment is almost second speed. As a PHPer program, it is very distressed to configure the environment. The lamp or LNMP system structure is often incomplete after a day, wasting a lot of time. If docker is used, the configuration environment is almost second fast. For one thing, docker has many powerful functions applied in the direction of operation and maintenance, but the blogger is a PHPer, so there is no in-depth explanation on docker in operation and maintenance. Here is a description of docker.

What is docker

Docker is an open source engine, which can easily create a lightweight, portable and self-sufficient container for any application. The containers that developers compile and test on the notebook can be deployed in batch in the production environment, including VMS (virtual machine), bare metal, openstack cluster and other basic application platforms.

Docker vs Vagrant

In terms of time, it takes several minutes for vagrant to start the virtual machine, while docker only takes a few seconds; In terms of volume, vagrant provides a complete virtual machine, while docker provides lightweight virtual containers, which share the same kernel and can run in independent processes; In addition, in terms of application scope, vagrant can only be used in the development environment, and docker can be used in both the development environment and the production environment.
So docker is much more powerful than traditional virtual machines

2、 Download docker tool docker toolbox

windows environment

1. Download from the official website

Download address
be careful:
If you are a win10 home version user, you cannot use docker for windows. Because the home version does not support Hyper-V, you must use docker for windowsWin10 professional users
Users of win10 and win8,7 can use docker toolbox
Boot2docker installation under Windows
Docker toolbox download address
Boot2docker installation under Windows
Boot2docker installation under Windows
This toolbox contains four things that will be used in the future, but do you find that downloading from the official website is extremely slow. We take another way to download from the alicloud image

2. Alicloud Download

Download address
Boot2docker installation under Windows

3. Daocloud Download

The download speed is also very fast
Download address
Boot2docker installation under Windows

3、 Installing docker toolbox

Install as Administrator
Boot2docker installation under Windows
Then next, select the installation path
Boot2docker installation under Windows
Then next, if Git is installed, remove GIT
Boot2docker installation under Windows
next step
Boot2docker installation under Windows
next step
Boot2docker installation under Windows
install
Boot2docker installation under Windows
complete
Boot2docker installation under Windows
There will be so many things on the desktop
Boot2docker installation under Windows
Files in the installation directory
Boot2docker installation under Windows

4、 Initialize docker and configure alicloud image

Docker Toolbox
Using docker toolbox on windows and MAC systems
It is recommended to configure the accelerator address when creating a Linux virtual machine

1. Create virtual machine

Open the CMD command line tool as an administrator
Boot2docker installation under Windows
Enter the docker toolbox installation directory
Boot2docker installation under Windows
Execute the following command
docker-machine create --engine-registry-mirror=<your accelerate address> -d virtualbox default
Installation succeeded
Boot2docker installation under Windows

2. Initialize docker

Access docker service through docker client
Open as AdministratorDocker Quickstart Terminal
Prompt to find bash.exe
Boot2docker installation under Windows
Bash.exe is located in the / git / bin / directory. Just select it
Boot2docker installation under Windows
The default IP address is 192.168.99.100
Boot2docker installation under Windows
Then we need to configure it
docker-machine env default
Boot2docker installation under Windows
implement
eval "$(docker-machine env default)"
docker info
The image is configured
Boot2docker installation under Windows
Mirror address reference:Alibaba cloud docker hub
Execute the following two commands

Docker PS # view image
Docekr version # view version

Boot2docker installation under Windows

3. Docker Hello world and Ubuntu images

Execute the following docker version of Hello World
docker run hello-world
Boot2docker installation under Windows
Next execution
docker run -it ubuntu bash
Download the Ubuntu image. If you are interested, you can try it. If you don’t use the Alibaba cloud image, the download speed is almost turtle speed, so you have to find a domestic image, or you have to wait until monkey years and horses
Boot2docker installation under Windows
When the download is completed, it will automatically jump to the root account of the container
Boot2docker installation under Windows

Reference documents
Docker official document
jb51
Alicloud documents

This work adoptsCC agreement, reprint must indicate the author and the link to this article

siya