主页 > 开源代码  > 

内网下,Ubuntu(24.10)离线安装docker最新版教程

内网下,Ubuntu(24.10)离线安装docker最新版教程

一般在数据比较敏感的情况下,是无法使用网络的,而对于Ubuntu系统来说,怎么离线安装docker呢?

下面我给大家来讲一下:

采用二进制安装:

1.下载docker离线包

官网下载:

Index of linux/static/stable/x86_64/ download.docker /linux/static/stable/x86_64/

2.解压离线包 tar -xvf docker-27.5.1.tgz 3.将解压的docker拷贝或移动到/usr/bin/目录下 sudo cp docker/* /usr/bin/ 4.编写docker.service 文件加入Linux服务当中并开启守护进程 sudo vim /etc/systemd/system/docker.service

添加内容:

[Unit] Description=Docker Application Container Engine Documentation= docs.docker After=network-online.target firewalld.service Wants=network-online.target [Service] Type=notify # the default is not to use systemd for cgroups because the delegate issues still # exists and systemd currently does not support the cgroup feature set required # for containers run by docker ExecStart=/usr/bin/dockerd -H unix:///var/run/docker.sock --selinux-enabled=false --default-ulimit nofile=65536:65536 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 the docker process if it exits prematurely Restart=on-failure StartLimitBurst=3 StartLimitInterval=60s [Install] WantedBy=multi-user.target 5.添加文件可执行权限 sudo chmod +x /etc/systemd/system/docker.service 6.配置成功后,重新加载 daemon 服务 , 并启动docker sudo systemctl daemon-reload sudo systemctl start docker

标签:

内网下,Ubuntu(24.10)离线安装docker最新版教程由讯客互联开源代码栏目发布,感谢您对讯客互联的认可,以及对我们原创作品以及文章的青睐,非常欢迎各位朋友分享到个人网站或者朋友圈,但转载请说明文章出处“内网下,Ubuntu(24.10)离线安装docker最新版教程