当前位置:   article > 正文

离线安装docker(已验证)_18.06.3-ce

18.06.3-ce
  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
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15
  • 16
  • 17
  • 18
  • 19
  • 20
  • 21
  • 22
  • 23
  • 24
  • 25
  • 26
  • 27
  • 28
  • 29
  • 30
  • 31
  • 32
  • 33
  • 34
  • 35
  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:***可以通过断开网络,下载,可以看到下载的路径,从而更换下载的内容。

声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/Li_阴宅/article/detail/970528
推荐阅读
相关标签
  

闽ICP备14008679号