Before that https://blog.csdn.net/fengbingchun/article/details/109559500 Chinese vs Docker Made a brief introduction , Here's an introduction Docker stay Ubuntu16.04 x86_64 64 On the position and Windows10 x86_64 64 Installation process on bit Home Edition .
stay Ubuntu Installation on Docker( or Docker engine ),Ubuntu Must be 64 Bit , the latest version Docker 19.03.13 Support only Ubuntu Version is 16.04、18.04、20.04. stay Ubuntu Installation on Docker There are three ways :(1). adopt Docker Warehouse ;(2). By downloading .deb file ;(3). Through script . Here is the installation of the first method .
If in Windows10 Non home version ( pro 、 Corporate or educational ) Installation on Docker( or Docker engine ), Requirements :(1).Windows10 The version number is 16299 And above ;(2). Must be turned on Hyper-V And container features ;(3). Having secondary address translation 64 Bit processor (64 bit processor with Second Level Address Translation (SLAT));(4). System memory cannot be lower than 4GB;(5). Must be in BIOS Enable... In settings BIOS Class II hardware virtualization support .
If in Widnows10 It's the home version Docker( or Docker engine ), Requirements :(1).Windows10 The version number is 1903 And above ;(2). stay Windows10 Enable on WSL(Windows Subsystem for Linux) 2 function ;(3). Having secondary address translation 64 Bit processor ;(4). System memory cannot be lower than 4GB;(5). Must be in BIOS Enable... In settings BIOS Class II hardware virtualization support .
stay Windows10 64 Install on bit home edition WSL 2 Operation steps :
(1). Enable for Linux Of Windows Subsystem , Open as administrator Windows PowerShell, And execute the following command :
dism.exe /online /enable-feature /featurename:Microsoft-Windows-Subsystem-Linux /all /norestart
(2). Enable virtual machine features , Open as administrator Windows PowerShell, And execute the following command :
dism.exe /online /enable-feature /featurename:VirtualMachinePlatform /all /norestart
(3). Restart the computer ;
(4). from https://docs.microsoft.com/zh-cn/windows/wsl/install-win10 download Linux Kernel update package wsl_update_x64.msi And install ;
(5). take WSL 2 Set to default version , open PowerShell, And execute the following command :
wsl --set-default-version 2
1. stay Ubuntu16.04 64 Install on the virtual machine Docker:
(1). If you have installed an older version of Docker, You should uninstall the old version first , Execute the following command to uninstall :
sudo apt-get remove docker docker-engine docker.io containerd runc
After executing the above order /var/lib/docker Contents under the directory , Including images 、 Containers 、 Files like volumes and networks still exist , If you don't need to save the existing data , And hope to start with a new installation , You need to continue with the following command :
sudo apt-get purge docker-ce docker-ce-cli containerd.io
sudo rm -rf /var/lib/docker
(2). Set up Docker Warehouse (repository), Execute the following command :
sudo apt-get update
sudo apt-get install apt-transport-https ca-certificates curl gnupg-agent software-properties-common
(3). add to Docker official GPG secret key , Execute the following command :
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
(4). Set up a stable warehouse (stable repository), Add stable version of Docker APT Mirror source , Execute the following command :
sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable"
(5). install Docker engine , Execute the following commands in turn :
sudo apt-get update
sudo apt-get install docker-ce docker-ce-cli containerd.io
(6). verification Docker Whether the engine is installed correctly , Execute the following command , The execution result is shown in the figure below , Instructions are correctly installed Docker engine :
sudo docker run hello-world
(7). If you want to use non root User identity use Docker, You need to establish docker User group , And add the current user to docker Group , Execute the following command , Log out and log in again :
sudo groupadd docker
sudo usermod -aG docker $USER
notes : If you use Docker Official source https://download.docker.com/linux/ubuntu Slow download , You can switch it to a domestic source , If the above paragraph 3 And the first step 4 In step https://download.docker.com/linux/ubuntu, Replace all with https://mirrors.ustc.edu.cn/docker-ce/linux/ubuntu/ that will do .
2. stay Windows10 64 Install on bit home edition Docker:
(1). stay Windows10 64 Install on bit home edition WSL 2;
(2). from https://hub.docker.com/editions/community/docker-ce-desktop-windows/ Download stable Version of Docker Desktop Installer.exe;
(3). Double click installation Docker Desktop Installer.exe, Check it out. " Enable WSL 2 function " Options ;
(4). Restart or log off the computer ;
(5). double-click "Docker Desktop" start-up Docker;
(6). Open as administrator Windows PowerShell, Enter the command "docker version", The results are as follows :
(7). verification Docker Whether the engine is installed correctly , Carry out orders "docker run hello-world", The execution result is shown in the figure below , Instructions are correctly installed Docker engine :