安装本地化docker registry,使其他机器能够发布容器

sudo docker pull registry:latest

docker run -d -p 5000:5000 --name registry registry:latest

 http://localhost:5000/v2/_catalog, 检查运行成功

此时在子机3号上访问:

http://192.168.170.130:5000/v2/_catalog, 

 登陆远程仓库,如果远程仓库没有配置authentication 验证登陆直接把image tag为 docker tag imagename registry:500/imagename, 然后docker push即可推送到registry, 否则要配置安全登陆需要login,要用htpasswd来自apache2-utils 包的htpasswd生成密钥再登陆:

 

sudo mkdir /etc/auth && mv ./htpasswd /etc/auth/

 

,

然后在worker机上要配置使http可以登陆到registry机仓库:

 worker机访问docker registry进行登陆:

 

 

登陆成功后要推送:

先将本地image tag: docker tag hello-world 192.168.170.130:5000/hello-world:latest

然后推送: docker push 192.168.170.130:5000/hello-world:latest, 就会推送成功

 

 查看已经推送的镜像:

 

posted @   calochCN  阅读(29)  评论(0编辑  收藏  举报
相关博文:
阅读排行:
· 分享一个免费、快速、无限量使用的满血 DeepSeek R1 模型,支持深度思考和联网搜索!
· 使用C#创建一个MCP客户端
· 基于 Docker 搭建 FRP 内网穿透开源项目(很简单哒)
· ollama系列1:轻松3步本地部署deepseek,普通电脑可用
· 按钮权限的设计及实现
点击右上角即可分享
微信分享提示