default

在linux上安装Docker

使用官方安装脚本自动安装

安装命令如下:

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

如果安装之后报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/ 这是非root用户没有权限运行docker命令的问题

只需要将其加入到我们用户组就行

sh
sudo usermod -aG docker $USER
sudo service docker restart

运行docker info查看docker是否安装成功

启动docker

sh
# service 命令的用法
$ sudo service docker start
 
# systemctl 命令的用法
$ sudo systemctl start docker