ubuntu17.10如何安装docker-ce

2023-04-19 07:14:00 docker 安装 Ubuntu17

在Ubuntu 17.10上安装Docker CE,需要按照以下步骤进行:

1、更新软件包索引并安装必要的软件包:

在终端输入以下命令:

sudo apt-get update

sudo apt-get install apt-transport-https ca-certificates curl software-properties-common

2、添加Docker的官方GPG密钥:

curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -

3、添加Docker的官方存储库:

sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable"

4、更新软件包索引:

sudo apt-get update

5、安装Docker CE:

sudo apt-get install docker-ce

6、检查是否安装成功:

sudo docker run hello-world

如果安装成功,会看到以下输出:

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/

这样,在Ubuntu 17.10中就安装成功了Docker CE,可以开始使用它进行容器化应用的开发和部署了。

相关文章