-
安装目录
mkdir /opt/docker && cd /opt/docker -
安装包下载
yum -y install wget && wget https://download.docker.com/linux/static/stable/x86_64/docker-24.0.7.tgz 注意:https://download.docker.com/linux/static/stable/x86_64 获取最新版本下载链接并替换(docker-xxx.tgz) -
安装包解压
tar -xvf docker-24.0.7.tgz && cp docker/* /usr/bin/ -
注册服务
sudo tee /usr/lib/systemd/system/docker.service <<-'EOF' [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 EOF -
镜像源配置
sudo mkdir -p /etc/docker/ sudo tee /etc/docker/daemon.json <<-'EOF' { "registry-mirrors": ["https://8q5nyauc.mirror.aliyuncs.com"] } EOF sudo systemctl daemon-reload sudo systemctl restart docker -
启动服务
启动:systemctl start docker 停止:systemctl stop docker 重启:systemctl restart docker 开机启动:systemctl enable docker
Docker离线安装
童心同萌2023-11-24 15:47
相关推荐
顺风尿一寸1 小时前
Java Socket 内核之旅:从 SocketChannel.read() 到 tcp_recvmsg 与 epoll 的完整调用链路lichenyang4537 小时前
Docker 学习笔记(五):Docker Compose,用一个 YAML 启动前端、后端和 MongoDBlichenyang4537 小时前
Docker 学习笔记(四):Dockerfile,把项目打成自己的镜像lichenyang4537 小时前
Docker 学习笔记(三):Docker 网络、bridge、子网和容器互通lichenyang4537 小时前
Docker 学习笔记(二):docker run 的参数到底在控制什么?XIAOHEZIcode7 小时前
Ubuntu 终端美化全栈指南:Bash 到 Kitty 踩坑实录唐青枫9 小时前
别再只会用 cron:Linux systemd Timer 定时任务实战详解AlfredZhao2 天前
生产环境里,为什么不建议把普通端口直接暴露到公网?戴为沐3 天前
Linux内存扩容指南zylyehuo4 天前
Linux 彻底且安全地删除文件