将本地docker镜像转为singularity镜像


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:latest

注:-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


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM