2.3. Ubuntu Docker installation

发布时间 :2025-10-25 12:31:07 UTC      

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 the x86x64 (or amd64) armhf,arm64,s390x (IBM Z) and ppc64le (IBM’s Power) architectures.

2.3.1. Use the official installation script to install automatically

The installation commands are as follows:

curl -fsSL https://get.docker.com | bash -s docker --mirror Aliyun

You can also use the domestic daocloud one-click installation command:

curl -sSL https://get.daocloud.io/docker | sh

2.3.2. Manual installation

Uninstall the old version

Older versions of Docker are called docker,docker.io or docker-engine. If installed, uninstall them:

$ sudo apt-get remove docker docker-engine docker.io containerd runc

Currently known as the Docker Engine-Community package docker-ce.

There are two ways to install Docker Engine-Community.

Use the Docker repository for installation

Before installing Docker Engine-Community on the new host for the first time, you need to set up the Docker repository. You can then install and update Docker from the repository.

Set up the warehouse

Update the apt package index.

$ sudo apt-get update

Install the apt dependency package, which is used to obtain the repository through HTTPS:

$ sudo apt-get install \\
    apt-transport-https \\
    ca-certificates \\
    curl \\
    gnupg-agent \\
    software-properties-common

Add the official GPG key for Docker:

$ 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 verifies that you now have a key with a fingerprint by searching for the last 8 characters of the 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) <docker@docker.com>
sub   rsa4096 2017-02-22 [S]

Use the following instructions to set up the stable version repository

$ sudo add-apt-repository \\
   "deb [arch=amd64] https://mirrors.ustc.edu.cn/docker-ce/linux/ubuntu/
\\
   $(lsb_release -cs) \\
   stable"

Install Docker Engine-Community

Update the apt package index.

$ sudo apt-get update

Install the latest version of Docker Engine-Community and containerd, or go to the next step to install a specific version:

$ sudo apt-get install docker-ce docker-ce-cli containerd.io

To install a specific version of Docker Engine-Community, list the available versions in the repository, and then select an installation. List the versions available in your warehouse:

$ 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
  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
  ...

Install a specific version using the version string in the second column, for example, 5 0~ubuntu-xenial 18.09.1 version 3-version.

$ sudo apt-get install docker-ce=<VERSION_STRING> docker-ce-cli=<VERSION_STRING> containerd.io

To test whether Docker is installed successfully, enter the following instructions and print out the following information for successful installation:

$ sudo docker run hello-world
Unable to find image 'hello-world:latest' locally
latest: Pulling from library/hello-world
1b930d010525: Pull complete

             Digest:
sha256:c3b4ada4687bbaa170745b3e4dd8ac3f194ca95b2d0518b417fb47e5879d9b5f
Status: Downloaded newer image for hello-world:latest
Hello from Docker!
This message shows that your installation appears to be working
correctly.
To generate this message, Docker took the following steps:
 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.
To try something more ambitious, you can run an Ubuntu container with:
 $ docker run -it ubuntu bash
Share images, automate workflows, and more with a free Docker ID:
 https://hub.docker.com/
For more examples and ideas, visit:
 https://docs.docker.com/get-started/

2.3.3. Install using Shell script

Docker in get.docker.com And test.docker.com Convenient scripts are provided on the for quick installation of edge versions and test versions of Docker Engine-Community. The source code for 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:

  • The script needs to run root or have sudo privileges. Therefore, you should carefully review and review the script before running it.

  • These scripts try to detect Linux distributions and versions and configure the package management system for you. In addition, the script does not allow you to customize any installation parameters. From the perspective of Docker or the guidelines and standards of your own organization, this can lead to unsupported configurations.

  • These scripts install all dependencies and recommendations of the package manager without confirmation. This may install a large number of packages, depending on the current configuration of the host.

  • The script does not provide the option to specify which version of Docker to install, but instead installs the latest version released in the edge channel.

  • If you have used other mechanisms to install Docker on the host, do not use convenient scripts.

This example uses the get.docker.com The script on the install the latest version of Docker Engine-Community on Linux. To install the latest test version, use test.docker.com instead. In each of the following commands, replace each occurrence of get with test.

$ curl -fsSL https://get.docker.com -o get-docker.sh
$ sudo sh get-docker.sh

If you want to use Docker as a non-root user, you should consider adding users to the docker group in a manner similar to the following:

$ sudo usermod -aG docker your-user

Uninstall docker

Delete the installation package:

sudo apt-get purge docker-ce

Delete images, containers, configuration files, etc.:

sudo rm -rf /var/lib/docker
Principles, Technologies, and Methods of Geographic Information Systems  102

In recent years, Geographic Information Systems (GIS) have undergone rapid development in both theoretical and practical dimensions. GIS has been widely applied for modeling and decision-making support across various fields such as urban management, regional planning, and environmental remediation, establishing geographic information as a vital component of the information era. The introduction of the “Digital Earth” concept has further accelerated the advancement of GIS, which serves as its technical foundation. Concurrently, scholars have been dedicated to theoretical research in areas like spatial cognition, spatial data uncertainty, and the formalization of spatial relationships. This reflects the dual nature of GIS as both an applied technology and an academic discipline, with the two aspects forming a mutually reinforcing cycle of progress.