江门市城乡建设局网站,网站子目录,拓客团队怎么联系,wordpress分类目录发不了文章在上篇文章中#xff0c;我们完成了应用程序容器化#xff0c;把webapi项目构建镜像并容器化运行。本文将会演示如何把自己构建的镜像上传到docker官网的仓库和自己私有仓库本地镜像推送到官网的registry1.创建仓库点击Docker Desktop图标-Repositories-》create 跳转到… 在上篇文章中我们完成了应用程序容器化把webapi项目构建镜像并容器化运行。本文将会演示如何把自己构建的镜像上传到docker官网的仓库和自己私有仓库本地镜像推送到官网的registry1.创建仓库点击Docker Desktop图标-Repositories-》create 跳转到官网创建页面 2.Docker tag 标记镜像、push推送镜像 到仓库使用一下命令推送本地镜像到仓库docker tag local-image:tagname new-repo:tagname
docker push new-repo:tagname
在操作之前执行登录命令否则会提示unauthorized: incorrect username or passworddocker loginUsername (mingchengnet):
Password:
Login Succeeded然后执行Tag和push命令 docker tag aastore.productcatalog.api:dev mingchengnet/aastore:devdocker push mingchengnet/aastore:dev
docker tag 后面的aastore.productcatalog.api:dev是你要上传的本地镜像。mingchengnet账号名称/aastore仓库名称:dev起的新镜像名称 成功提示The push refers to repository [docker.io/mingchengnet/aastore]
cd7e3f7827e5: Pushed
bf4376f176a3: Pushed
d86ec58d3137: Pushed
8c30868fe23a: Pushed
886801dff0ea: Pushed
49b759454bb2: Pushed
95ef25a32043: Pushed
dev: digest: sha256:109d899344cd6524b32f02f484feaac5382d0dff24cfe55801d645e6e56c3910 size: 1794
推送、并搭建私有的registry1.拉取Docker 官方提供了一个搭建私有仓库的镜像 registry运行容器并暴露端口5050映射端口5000docker pull registry
docker run -d -p 5050:5000 --restartalways registry
在浏览器里访问http://127.0.0.1:5050/v2/ 输出{}表示私有仓库搭建成功 2.执行Tag标记镜像和push上传镜像命令docker tag aastore.productcatalog.api:dev localhost:5050/aastore.productcatalog.api:v1.0
docker push localhost:5050/aastore.productcatalog.api:v1.0
输出v1.0: Pulling from aastore.productcatalog.api
Digest: sha256:109d899344cd6524b32f02f484feaac5382d0dff24cfe55801d645e6e56c3910
Status: Image is up to date for localhost:5050/aastore.productcatalog.api:v1.0
localhost:5050/aastore.productcatalog.api:v1.0
在浏览器里访问http://127.0.0.1:5050/v2/_catalog就能看到仓库中包含镜像aastore.productcatalog.api下篇演示如何运行在k8s中。