1.建立本地docker镜像仓库
①下载registry镜像
# docker pull registry
②配置http权限支持
# vim /etc/docker/daemon.json
{
"insecure-registries": ["192.168.1.55:5000"]
}
注:192.168.1.55是你的本机ip
③重启docker服务
# systemctl restart docker
④运行registry的容器
# docker run -d -p 5000:5000 -v /tmp/registry:/var/lib/registry --name registry registry:lastest
注:-v确保容器停止后,上传的镜像不会丢失。
⑤设置要上传镜像的tag
# docker tag hello-world 192.168.1.55:5000/hello-world
⑥将镜像push到本地仓库
# docker push 192.168.1.55:5000/hello-world
⑦查看
# curl http://192.168.1.55:5000/v2/_catalog
{"repositories":["hello-world"]}
2.生成singularity镜像
# singularity build --nohttps hello-world.sif docker://192.168.1.55:5000/hello-world