- 下载docker镜像
https://download.docker.com/linux/static/stable/x86_64/ - 解压文件
tar -xf docker-18.06.3-ce.tgz - 将文件拷贝到/usr/bin
sudo cp docker/* /usr/bin/ - 配置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
-
启动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 -
调用docker加载image
sudo docker load -i image_1.tar -
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:***可以通过断开网络,下载,可以看到下载的路径,从而更换下载的内容。