- 本地下载docker 包,计算节点拷贝
docker FTP 下载路径:https://download.docker.com/linux/
wget -c https://download.docker.com/linux/static/stable/x86_64/docker-24.0.7.tgz
tar xzvf docker-24.0.7.tgz
cp /share/software/docker_rpm/docker/* /usr/bin #计算节点上操作
#测试计算节点1
(base) [root@comput1 docker]# docker version
Client:
Version: 24.0.7
API version: 1.43
Go version: go1.20.10
Git commit: afdd53b
Built: Thu Oct 26 09:04:00 2023
OS/Arch: linux/amd64
Context: default
##此时docker 还不能使用
(base) [root@comput1 docker_rpm]# docker load < ensembl-vep.tar
Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running?
#配置docker.service
touch /etc/systemd/system/docker.service #新建docker.service
vim /etc/systemd/system/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
ExecStart=/usr/bin/dockerd
ExecReload=/bin/kill -s HUP $MAINPID
LimitNOFILE=infinity
LimitNPROC=infinity
TimeoutStartSec=0
Delegate=yes
KillMode=process
Restart=on-failure
StartLimitBurst=3
StartLimitInterval=60s
[Install]
WantedBy=multi-user.target
###########################
(base) [root@comput1 docker_rpm]# systemctl start docker
(base) [root@comput1 docker_rpm]# systemctl status docker
● docker.service - Docker Application Container Engine
Loaded: loaded (/etc/systemd/system/docker.service; disabled; vendor preset: disabled)
Active: active (running) since Tue 2024-01-16 13:08:10 CST; 34s ago
Docs: https://docs.docker.com
Main PID: 149205 (dockerd)
Tasks: 69
Memory: 34.5M
CGroup: /system.slice/docker.service
├─149205 /usr/bin/dockerd
└─149239 containerd --config /var/run/docker/containerd/containerd.toml
...
...
[root@comput1 docker_rpm]# docker version
Client:
Version: 24.0.7
API version: 1.43
Go version: go1.20.10
Git commit: afdd53b
Built: Thu Oct 26 09:04:00 2023
OS/Arch: linux/amd64
Context: default
Server: Docker Engine - Community
Engine:
Version: 24.0.7
API version: 1.43 (minimum version 1.12)
Go version: go1.20.10
Git commit: 311b9ff
Built: Thu Oct 26 09:05:28 2023
OS/Arch: linux/amd64
Experimental: false
containerd:
Version: v1.7.6
GitCommit: 091922f03c2762540fd057fba91260237ff86acb
runc:
Version: 1.1.9
GitCommit: v1.1.9-0-gccaecfc
docker-init:
Version: 0.19.0
GitCommit: de40ad0
############
[root@comput1 docker_rpm]# mkdir /etc/docker
[root@comput1 docker_rpm]# touch /etc/docker/daemon.json
[root@comput1 docker_rpm]# vim /etc/docker/daemon.json
(base) [root@comput1 test1]# cat /etc/docker/daemon.json #配置文件可以重新写
{
"data-root":"/share/software/docker_rpm/docker-data",
}
[root@comput1 docker_rpm]# systemctl daemon-reload
[root@comput1 docker_rpm]# systemctl start docker
[root@comput1 docker_rpm]# systemctl enable docker #开机自启动
[root@comput1 docker_rpm]# systemctl status docker
[root@comput1 docker_rpm]# docker system df
#docker 的存储目录
/var/lib/docker/overlay2/
- 镜像打包到本地,导入本地镜像
[root@master docker_rpm]# docker images
REPOSITORY TAG IMAGE ID CREATED SIZE
ensemblorg/ensembl-vep latest bbc0ef8e3990 3 months ago 838MB
griffithlab/pvactools latest 981a3b8b2bd8 4 months ago 9.18GB
[root@master docker_rpm]# docker save -o ensembl-vep.tar bbc0ef8e3990
[root@master docker_rpm]# docker save -o pvactools.tar 981a3b8b2bd8
[root@comput1 docker_rpm]# docker load -i ensembl-vep.tar
[root@comput1 docker_rpm]# docker images
REPOSITORY TAG IMAGE ID CREATED SIZE
<none> <none> bbc0ef8e3990 3 months ago 838MB
## docker save 打包 image id 会不显示 REPOSITORY 和 TAG
##docer 重新打包
[root@master docker_rpm]# docker save -o ensembl-vep110.tar ensemblorg/ensembl-vep
[root@master docker_rpm]# docker save -o pvactools.tar griffithlab/pvactools
[root@comput1 docker_rpm]# docker images
REPOSITORY TAG IMAGE ID CREATED SIZE
ensemblorg/ensembl-vep latest bbc0ef8e3990 3 months ago 838MB
griffithlab/pvactools latest 981a3b8b2bd8 4 months ago 9.18GB
###显示正常
[root@comput1 docker_rpm]# docker run -it ensemblorg/ensembl-vep # 进入容器
在不同计算节点内重复以上操作,配置完成。
slurm集群 sbatch 投递任务,会出现“docker ... /var/run/docker.sock” 没有权限
chmod 777 /var/run/docker.sock
投递ok ~~~
docker安装参考:
Linux下Docker 离线安装详细步骤及最常用命令,亲测成功_断网的linux上安装docker-CSDN博客