Last update at :2024-05-18,Edit by888u
Docker Engine-Community supports the following Ubuntu versions:
- Xenial 16.04 (LTS)
- Bionic 18.04 (LTS)
- Cosmic 18.10
- Disco 19.04
- Other newer versions...
Docker Engine – Community supports x86_64 (or amd64) armhf, arm64, s390x (IBM Z), and ppc64le (IBM Power) architectures.
Automatically install using the official installation script
The installation command is as follows:
curl -fsSL https://get.docker.com | bash -s docker --mirror Aliyun
You can also use the one-click installation command of daocloud in mainland China:
curl -sSL https://get.daocloud.io/docker | sh
Manual installation
Uninstall old version
Older versions of Docker were called docker, docker.io or docker-engine. If installed, uninstall them:
$ sudo apt-get remove docker docker-engine docker.io containerd runc
Currently called the Docker Engine-Community package docker-ce .
Install Docker Engine-Community, two methods are introduced below.
Installation using Docker repository
Before installing Docker Engine-Community for the first time on a new host, you need to set up a Docker repository. Afterwards, you can install and update Docker from the repository.
Set up warehouse
Update apt package index.
$ sudo apt-get update
Install the apt dependency package to obtain the repository via HTTPS:
$ sudo apt-get install /
apt-transport-https /
ca-certificates /
curl /
gnupg-agent /
software-properties-common
Add Docker’s official GPG key:
$ curl -fsSL https://mirrors.ustc.edu.cn/docker-ce/linux/ubuntu/gpg | sudo apt-key add -
9DC8 5822 9FC7 DD38 854A E2D8 8D81 803C 0EBF CD88 Verify that you now have the key with the fingerprint by searching for the last 8 characters of the fingerprint.
$ sudo apt-key fingerprint 0EBFCD88
pub rsa4096 2017-02-22 [SCEA] Use the following commands to set up the stable version repository
$ sudo add-apt-repository / Update apt package index.
Install the latest versions of Docker Engine-Community and containerd, or go to the next step to install a specific version:
To install a specific version of Docker Engine-Community, list the available versions in the repository and select one to install. List the versions available in your repository:
$ apt-cache madison docker-ce
docker-ce | 5:18.09.1~3-0~ubuntu-xenial | https://mirrors.ustc.edu.cn/docker-ce/linux/ubuntu xenial/stable amd64 Packages Use the version string in the second column to install a specific version, for example 5:18.09.1~3-0~ubuntu-xenial.
To test whether Docker is installed successfully, enter the following command and print out the following information, indicating that the installation is successful:
$ sudo docker run hello-world
Unable to find image ‘hello-world:latest’ locally Hello from Docker! To generate this message, Docker took the following steps: To try something more ambitious, you can run an Ubuntu container with: Share images, automate workflows, and more with a free Docker ID: For more examples and ideas, visit: Docker provides convenience scripts at get.docker.com and test.docker.com for quickly installing edge and test versions of Docker Engine-Community. The source code of the script is in the docker-install repository. It is not recommended to use these scripts in a production environment, and you should be aware of the potential risks before using them:
This example uses the script at get.docker.com to install the latest version of Docker Engine-Community on Linux. To install the latest test version, use test.docker.com instead. In each command below, replace each occurrence of get with test.
If you want to use Docker as a non-root user, you should consider adding the user to the docker group using something like:
Remove the installation package:
Delete images, containers, configuration files, etc.:
Recommended site searches: org domain name, free mainland China space, free domain name registration with 0 yuan registration, php hosting, instant IP server replacement, cn domain name personal registration Hong Kong server rental, US hosting reviews, US virtual space, mainland China space,
9DC8 5822 9FC7 DD38 854A E2D8 8D81 803C 0EBF CD88
uid [unknown] Docker Release (CE deb)
sub rsa4096 2017-02-22 [S]
"deb [arch=amd64] https://mirrors.ustc.edu.cn/docker-ce/linux/ubuntu/ /
$(lsb_release -cs) /
"stable"
Install Docker Engine-Community
$ sudo apt-get update
$ sudo apt-get install docker-ce docker-ce-cli containerd.io
docker-ce | 5:18.09.0~3-0~ubuntu-xenial | https://mirrors.ustc.edu.cn/docker-ce/linux/ubuntu xenial/stable amd64 Packages
docker-ce | 18.06.1~ce~3-0~ubuntu | https://mirrors.ustc.edu.cn/docker-ce/linux/ubuntu xenial/stable amd64 Packages
docker-ce | 18.06.0~ce~3-0~ubuntu | https://mirrors.ustc.edu.cn/docker-ce/linux/ubuntu xenial/stable amd64 Packages
…
$ sudo apt-get install docker-ce=
latest: Pulling from library/hello-world
1b930d010525: Pull complete Digest: sha256:c3b4ada4687bbaa170745b3e4dd8ac3f194ca95b2d0518b417fb47e5879d9b5f
Status: Downloaded newer image for hello-world:latest
This message shows that your installation appears to be working correctly.
1. The Docker client contacted the Docker daemon.
2. The Docker daemon pulled the “hello-world” image from the Docker Hub.
(amd64)
3. The Docker daemon created a new container from that image which runs the
executable that produces the output you are currently reading.
4. The Docker daemon streamed that output to the Docker client, which sent it
to your terminal.
$ docker run -it ubuntu bash
https://hub.docker.com/
https://docs.docker.com/get-started/
Installation using Shell Script
$ curl -fsSL https://get.docker.com -o get-docker.sh
$ sudo sh get-docker.sh
$ sudo usermod -aG docker your-user
Uninstall docker
sudo apt-get purge docker-ce
sudo rm -rf /var/lib/docker
发表评论