赞
踩
curl -fsSL https://get.docker.com | bash -s docker --mirror Aliyun
查看是否安装成功
docker --version
root@VM-12-5-ubuntu:~# docker --version
Docker version 20.10.11, build dea9396
sudo mkdir -p /etc/docker
sudo tee /etc/docker/daemon.json <<-'EOF'
{
"registry-mirrors": ["https://i1el1i0w.mirror.aliyuncs.com"],
"data-root": "/data/docker"
}
EOF
sudo systemctl daemon-reload
sudo systemctl restart docker
注意:直接复制粘贴,特别是注意空格和换行问题
如果没有配置则显示无此文件
cat /etc/docker/daemon.json
curl -L "https://github.com/docker/compose/releases/download/1.28.3/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose
chmod +x /usr/local/bin/docker-compose
sudo ln -s /usr/local/bin/docker-compose /usr/bin/docker-compose
root@VM-12-5-ubuntu:/usr/local/bin# docker-compose --version
docker-compose version 1.28.3, build 14736152
root@test:/etc# systemctl enable docker.service
Synchronizing state of docker.service with SysV service script with /lib/systemd/systemd-sysv-install.
Executing: /lib/systemd/systemd-sysv-install enable docker
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。