(一) 部署docker
1.更新系统:
sudo apt -y update
2.安装依赖项:
sudo apt -y install apt-transport-https ca-certificates curl gnupg-agent software-properties-common
3.安装Docker ce
导入存储库密钥:
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --dearmor -o /etc/apt/trusted.gpg.d/docker-archive-keyring.gpg
将Docker CE存储库添加到Ubuntu:
sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable"
安装Docker ce:
sudo apt update
sudo apt install docker-ce docker-ce-cli containerd.io
将用户添加到docker组:
sudo usermod -aG docker $USER
newgrp docker
设置docker开机启动
# 启动
systemctl start docker
# 开机启动
systemctl enable docker<