docker 安装 参考官网文档,读文档可知,官方提供了一个安装用的脚本,通过执行这个脚本,就可一键安装 docker engine,很方便。

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

我在 centos8 上安装时遇到报错

Error: 
 Problem: problem with installed package buildah-1.11.6-7.module_el8.2.0+305+5e198a41.x86_64
  - package buildah-1.11.6-7.module_el8.2.0+305+5e198a41.x86_64 requires runc >= 1.0.0-26, but none of the providers can be installed

直接卸载 runc 再重新执行脚本即可成功安装。

$sudo rpm -e runc --nodeps
$sudo sh get-docker.sh
...

================================================================================

To run Docker as a non-privileged user, consider setting up the
Docker daemon in rootless mode for your user:

    dockerd-rootless-setuptool.sh install

Visit https://docs.docker.com/go/rootless/ to learn about rootless mode.


To run the Docker daemon as a fully privileged service, but granting non-root
users access, refer to https://docs.docker.com/go/daemon-access/

WARNING: Access to the remote API on a privileged Docker daemon is equivalent
         to root access on the host. Refer to the 'Docker daemon attack surface'
         documentation for details: https://docs.docker.com/go/attack-surface/

================================================================================

安装完成后,需要手动启动服务

$sudo systemctl start docker
Logo

腾讯云面向开发者汇聚海量精品云计算使用和开发经验,营造开放的云计算技术生态圈。

更多推荐