linux任何系统都可以离线安装docker

docker离线安装包下载:
docker版本:docker-19.03.9.tgz和docker-20.10.2.tgz
https://download.csdn.net/download/qq_14910065/87683473

1.安装docker

#任选择一个版本
tar -xvf docker-19.03.9.tgz
tar -xvf docker-20.10.2.tgz
cp docker/*  /usr/bin/ #复制解压下的二进制文件到bin下
cp  docker.service /etc/systemd/system/docker.service
chmod +x /etc/systemd/system/docker.service 
systemctl daemon-reload
systemctl start docker
systemctl enable docker.service

2.安装docker-compose

sudo cp docker-compose-Linux-x86_64 /usr/local/bin/docker-compose
sudo chmod +x /usr/local/bin/docker-compose

3.添加镜像加速器

cat > /etc/docker/daemon.json << EOF
{
  "registry-mirrors": ["https://qj799ren.mirror.aliyuncs.com"],
   "insecure-registries": ["0.0.0.0/0"],
  "exec-opts": ["native.cgroupdriver=systemd"],
  "log-driver": "json-file",
  "log-opts": {
    "max-size": "100m"
  },
  "storage-driver": "overlay2"
}
EOF

systemctl restart docker  && systemctl status docker

你可能感兴趣的:(docker容器相关,docker)