docker-搭建私服仓库并推送镜像到私服仓库
安装私有仓库
拉取镜像
docker pull registry
将镜像启动
docker run -d -p 5000:5000 registry
查看私服上的镜像
curl -XGET http://127.0.0.1:5000/v2/_catalog
将仓库地址添加到docker
[root@localhost ~]# vim /etc/docker/daemon.json
[root@localhost ~]# cat /etc/docker/daemon.json
{
"registry-mirrors": ["https://3dcko41g.mirror.aliyuncs.com"],
"insecure-registries":["127.0.0.1:5000"]
}
重启docker
service docker restart
推送镜像
将修改后的容器制作为镜像
docker commit -m="msg" -a="tlj" c10659b0e25c myzoo:1.2
给镜像加上tag
Usage: docker tag SOURCE_IMAGE[:TAG] TARGET_IMAGE[:TAG]
docker tag myzoo:1.2 127.0.0.1:5000/myzoo:1.2
推送到私有仓库
Usage: docker push [OPTIONS] NAME[:TAG]
Push an image or a repository to a registry
Options:
-a, --all-tags Push all tagged images in the repository
--disable-content-trust Skip image signing (default true)
-q, --quiet Suppress verbose output
docker push 127.0.0.1:5000/myzoo:1.2
【推荐】国内首个AI IDE,深度理解中文开发场景,立即下载体验Trae
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】抖音旗下AI助手豆包,你的智能百科全书,全免费不限次数
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步
· 震惊!C++程序真的从main开始吗?99%的程序员都答错了
· 【硬核科普】Trae如何「偷看」你的代码?零基础破解AI编程运行原理
· 单元测试从入门到精通
· 上周热点回顾(3.3-3.9)
· winform 绘制太阳,地球,月球 运作规律