This is the 24th day of my participation in the August Text Challenge.More challenges in August
Docker
The installation
docker
Automatic installation
Automatic installation using the official installation script
curl -fsSL https://get.docker.com | bash -s docker --mirror Aliyun
Copy the code
docker
Manual installation
Environment to prepare
- Need to know a little bit
Linux
basis Ubuntu
(have aLinux
Server, althoughdocker
Can be found inWindows
/Mac OS
But you still want to use itLinux
System)xShell
Remotely connect to the server
Environment view
#System kernel
$ uname -r5.11.0-25 - genericCopy the code
#System version
$ cat /etc/os-releaseNAME="Ubuntu" VERSION="20.04.2 LTS (Focal Fossa)" ID= Ubuntu ID_LIKE=debian PRETTY_NAME="Ubuntu 20.04.2 LTS" VERSION_ID = "20.04" HOME_URL = "https://www.ubuntu.com/" SUPPORT_URL = "https://help.ubuntu.com/" BUG_REPORT_URL="https://bugs.launchpad.net/ubuntu/" PRIVACY_POLICY_URL="https://www.ubuntu.com/legal/terms-and-policies/privacy-policy" VERSION_CODENAME=focal UBUNTU_CODENAME=focalCopy the code
The installation
Documentation: docs.docker.com/engine/inst…
1. Uninstall the earlier version
$ sudo apt-get remove docker docker-engine docker.io containerd runc
Copy the code
2. Required installation package
- Update apt package index.
$ sudo apt-get update
Copy the code
- The installation
apt
Dependency package, used to passHTTPS
To get the warehouse:
$sudo apt-get install \ apt-transport-https \ ca-certificates \ curl \ gnupg \ lsb-release
Copy the code
3. Add the Docker GPG key
- Officially, not recommended
$ curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --dearmor -o /usr/share/keyrings/docker-archive-keyring.gpg
Copy the code
- Aliyun, recommended
$ curl -fsSL https://mirrors.aliyun.com/docker-ce/linux/ubuntu/gpg | sudo apt-key add -
Copy the code
4. Verify that you now have a key with a fingerprint.
$ sudo apt-key fingerprint 0EBFCD88
pub rsa4096 2017-02-22 [SCEA]
9DC8 5822 9FC7 DD38 854A E2D8 8D81 803C 0EBF CD88
uid [ unknown] Docker Release (CE deb) <[email protected]>
sub rsa4096 2017-02-22 [S]
Copy the code
5. Set up a stable warehouse
- Officially not recommended
$ echo \
"deb [arch=amd64 signed-by=/usr/share/keyrings/docker-archive-keyring.gpg] https://download.docker.com/linux/ubuntu \
$(lsb_release -cs) stable" | sudo tee /etc/apt/sources.list.d/docker.list > /dev/null
Copy the code
- Aliyun Recommendation
$ sudo add-apt-repository "deb [arch=amd64] https://mirrors.aliyun.com/docker-ce/linux/ubuntu $(lsb_release -cs) stable"
Copy the code
Install the Docker engine
-
Install the latest version
- update
apt
Package index
$ sudo apt-get update Copy the code
- The installationThe latest versionthe
Docker Engine
andcontainerd
$ sudo apt-get install docker-ce docker-ce-cli containerd.io Copy the code
- update
-
Install the specified version
- First list the versions available in the repository:
$apt - cache Madison docker - ce version # below for docker docker - ce | ". 10.8 ~ 3-0 ~ ubuntu - focal | https://mirrors.aliyun.com/docker-ce/linux/ubuntu focal/stable amd64 Packages docker - ce | ". 10.8 ~ 3-0 ~ ubuntu - focal | https://download.docker.com/linux/ubuntu focal/stable amd64 Packages docker - ce | ". 10.7 ~ 3-0 ~ ubuntu - focal | https://mirrors.aliyun.com/docker-ce/linux/ubuntu focal/stable amd64 Packages docker - ce | ". 10.7 ~ 3-0 ~ ubuntu - focal | https://download.docker.com/linux/ubuntu focal/stable amd64 Packages docker - ce | ". 10.6 ~ 3-0 ~ ubuntu - focal | https://mirrors.aliyun.com/docker-ce/linux/ubuntu focal/stable amd64 PackagesCopy the code
- Select the specified version to install
$sudo apt-get install Docker-ce =5:20.10.8~3-0~ubuntu-focal Docker-ce -cli=5:20.10.8~3-0~ Ubuntu-focal Containerd.ioCopy the code
Docker-ce: Community edition, official recommendation
Docker-ee: Enterprise Edition