Docker 是一个开源的应用容器引擎,可以打包、发布和运行应用。以下是在您的系统上安装 Docker 的步骤。

安装 Docker

系统要求

在开始安装之前,请确保您的系统满足以下要求:

  • 操作系统:Ubuntu 18.04 或更高版本,CentOS 7 或更高版本,Debian 9 或更高版本
  • 硬件:64 位处理器

安装步骤

  1. 更新系统包列表
sudo apt-get update
  1. 安装 Docker
sudo apt-get install docker-ce docker-ce-cli containerd.io
  1. 启动 Docker
sudo systemctl start docker
  1. 验证安装
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 daemon was started.
2. The Docker client contacted the Docker daemon.
3. A new container from an image with ID hello-world was created.
4. That container was started.
5. The `/hello` command in that container was executed, which outputs the "Hello from Docker!" message.
6. The container was terminated.

扩展阅读

如果您想了解更多关于 Docker 的信息,请访问我们的 Docker 教程

图片

Docker