docker离线安装、linux 安装docker
之前写过一篇docker的离线安装,现在从头再看繁琐了,服务器换了,既然要重搭一遍就要改进一下了。下面步入正题:
1.下载离线软件包
https://download.docker.com/linux/static/stable/x86_64/docker-20.10.6.tgz
2.下载安装工具包:github上点开下面链接再点击code,下载压缩包即可
https://github.com/Jrohy/docker-install/
3.上传服务器后解压安装工具包:
unzip docker-install-master.zip
4.进入docker-install-master文件,找install.sh授权:
cd docker-install-master/
chmod +x install.sh
5.授权完成,复制安装脚本到你放docker压缩包的地方
cp -a install.sh /dream/rte/docker/
6.安装docker
./install.sh -f docker-20.10.6.tgz
7.检查是否安装成功
docker info
8.查看docker版本
docker -v
9.启动docker
systemctl start docker
10.查看运行状态
systemctl status docker
11.设置开机自启
systemctl enable docker
要关闭自启使用:
systemctl disable docker
更换镜像源;
echo '{"registry-mirrors": ["https://<your-account-id>.mirror.aliyuncs.com"]}' | sudo tee /etc/docker/daemon.json
sudo systemctl restart docker
更换腾讯云
echo '{"registry-mirrors": ["https://1000xxx3421.mirror.ccs.tencentyun.com"]}' | sudo tee /etc/docker/daemon.json
sudo systemctl restart docker
用下面的直接省事:
cat <<EOF > /etc/docker/daemon.json
{"registry-mirrors": ["https://docker.mirrors.ustc.edu.cn","http://hub-mirror.c.163.com","https://mirrors.aliyun.com","https://mirror.ccs.tencentyun.com"],"max-concurrent-downloads": 10,"log-driver": "json-file","log-level": "warn","log-opts": {"max-size": "10m","max-file": "3"},"data-root": "/var/lib/docker"
}
EOF
按本方法安装非常简单明了。后期就是安装你所需要的各个中间件了,喜欢就留言你想安装的中间件