如何在Ubuntu 20.04上安装Docker

从标准Ubuntu存储库安装Docker

  • 使用apt命令安装docker.io包:
sudo apt install docker.io
  • 启动Docker并启用它在系统重新启动后启动:
$ sudo systemctl enable --now docker
  • 可选地向Docker提供任何用户管理权限:
$ sudo usermod -aG docker SOMEUSERNAME
  • 检查Docker版本:
$ docker --version
  • 运行Docker“Hello-World”容器进行测试:
$ 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)

日期:2020-07-07 20:55:22 来源:oir作者:oir