如何将 docker 镜像推送到私有存储库 [英] How to push a docker image to a private repository

查看:29
本文介绍了如何将 docker 镜像推送到私有存储库的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个标记为 me/my-image 的 docker 镜像,并且我在 dockerhub 上有一个名为 me-private 的私有存储库.
当我推送我的 me/my-image 时,我最终总是点击公共存储库.

I have a docker image tagged as me/my-image, and I have a private repo on the dockerhub named me-private.
When I push my me/my-image, I end up always hitting the public repo.

专门将我的图像推送到我的私人存储库的确切语法是什么?

What is the exact syntax to specifically push my image to my private repo?

推荐答案

您需要先使用 registryhost 正确标记您的图像:

You need to tag your image correctly first with your registryhost:

docker tag [OPTIONS] IMAGE[:TAG] [REGISTRYHOST/][USERNAME/]NAME[:TAG]

然后 docker push 使用相同的标签.

Then docker push using that same tag.

docker push NAME[:TAG]

示例:

docker tag 518a41981a6a myRegistry.com/myImage
docker push myRegistry.com/myImage

这篇关于如何将 docker 镜像推送到私有存储库的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆