离线安装docker(已验证)

  1. 下载docker镜像
    https://download.docker.com/linux/static/stable/x86_64/
  2. 解压文件
    tar -xf docker-18.06.3-ce.tgz
  3. 将文件拷贝到/usr/bin
    sudo cp docker/* /usr/bin/
  4. 配置docker
    vim /etc/systemd/system/docker.service
docker.service
 
[Unit]
Description=Docker Application Container Engine
Documentation=https://docs.docker.com
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
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
  1. 启动docker前配置(报错Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running?的解决方案也是后面两条)
    sudo chmod +x /etc/systemd/system/docker.service
    sudo systemctl daemon-reload
    sudo systemctl start docker

  2. 调用docker加载image
    sudo docker load -i image_1.tar

  3. nvidia-docker离线安装
    请参考“https://blog.csdn.net/chenmaolin88/article/details/86242997”
    下载安装:
    apt download libnvidia-container1
    apt download libnvidia-container-tools
    apt download nvidia-container-toolkit
    apt download nvidia-container-runtime
    apt download nvidia-docker2

需要另外下载一个
apt download nvidia-container-toolkit
且其与“apt download nvidia-container-runtime-hook”冲突,所以只需要下载toolkit;
安装完之后就可以使用nvidia-docker了。
***tips:***可以通过断开网络,下载,可以看到下载的路径,从而更换下载的内容。

  • 1
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值