docker离线安装并修改存储目录

docker下载

根据cpu选择不同版本,正常x86就选x86_64

下载地址:https://download.docker.com/linux/static/stable/

docker安装

bash 复制代码
tar -zxvf arm-docker-25.0.4.tgz
sudo cp docker/* /usr/bin/
rm -rf docker/*
mkdir /etc/docker
vi /etc/docker/daemon.json

填入内容

bash 复制代码
{
  "data-root": "/data/docker"
}

设置启动项

bash 复制代码
vi /usr/lib/systemd/system/docker.service

填入内容

bash 复制代码
[Unit]
Description=Docker Application Container Engine
Documentation=http://docs.docker.com
After=network.target docker.socket
[Service]
Type=notify
EnvironmentFile=-/run/flannel/docker
WorkingDirectory=/usr/local/bin
ExecStart=/usr/bin/dockerd \
                -H tcp://0.0.0.0:4243 \
                -H unix:///var/run/docker.sock \
                --selinux-enabled=false \
                --log-opt max-size=1g
ExecReload=/bin/kill -s HUP $MAINPID
# Having non-zero Limit*s causes performance problems due to accounting overhead
# in the kernel. We recommend using cgroups to do container-local accounting.
LimitNOFILE=infinity
LimitNPROC=infinity
LimitCORE=infinity
# Uncomment TasksMax if your systemd version supports it.
# Only systemd 226 and above support this version.
#TasksMax=infinity
TimeoutStartSec=0
# set delegate yes so that systemd does not reset the cgroups of docker containers
Delegate=yes
# kill only the docker process, not all processes in the cgroup
KillMode=process
Restart=on-failure
[Install]
WantedBy=multi-user.target

docker启动

bash 复制代码
systemctl daemon-reload
systemctl start docker
相关推荐
小Pawn爷32 分钟前
4.镜像仓库
docker
江湖有缘2 小时前
零基础入门:使用 Docker 快速部署 Organizr 个人主页
java·服务器·docker
广州中轴线3 小时前
OpenStack on Kubernetes 生产部署实战(十三)
容器·kubernetes·openstack
礼拜天没时间.4 小时前
深入Docker架构——C/S模式解析
linux·docker·容器·架构·centos
猫头虎4 小时前
如何使用Docker部署OpenClaw汉化中文版?
运维·人工智能·docker·容器·langchain·开源·aigc
会周易的程序员5 小时前
openplc runtimev4 Docker 部署
运维·c++·物联网·docker·容器·软件工程·iot
小Pawn爷5 小时前
1.Docker基础
运维·docker·容器
chinesegf5 小时前
清理docker残留镜像images
运维·docker·容器
小Pawn爷5 小时前
2.Docker的存储
运维·docker·容器
广州中轴线6 小时前
OpenStack on Kubernetes 生产部署实战(十七)
容器·kubernetes·openstack