在Docker Hub上共享Docker映像

An image like the one we created in the Node.js Hello World Docker Container from scratch post is simple, yet it’s a perfect example to try one of the cool features of Docker, provided through Docker Hub, the official hosting service of public and private Docker Images.

像我们从头开始Node.js Hello World Docker Container中创建的图像一样简单,但它是尝试通过Docker Hub提供的Docker酷功能之一的完美示例,Docker Hub是公共和私有的官方托管服务Docker映像。

Before we can do that, however, we need to register on Docker Hub.

但是,在此之前,我们需要在Docker Hub上注册。

Docker Hub is free in its basic plan which includes unlimited public repos and one private repo. For more than that, there are paid plans.

Docker Hub是免费的基本计划,其中包括无限的公共存储库和一个私有存储库。 不仅如此,还有付费计划。

Once you register and login, you will see your dashboard:

注册并登录后,您将看到仪表板:

Now using your username, you need to login from the command line using docker login:

现在使用您的用户名,您需要使用docker login从命令行docker login

docker login --username <username>

Now you can use docker tag to create the image, and docker push to push it to Docker Hub:

现在,您可以使用docker tag创建映像,然后使用docker push其推送到Docker Hub:

docker tag <image> <username>/<tagname>
docker push <username>/<tagname>

If you forget to login, you will get a denied: requested access to the resource is denied error message when you run docker push.

如果您忘记登录,则会得到denied: requested access to the resource is denied运行docker push时, denied: requested access to the resource is denied错误消息。

Now you should see your image on the repositories list in Docker Hub:

现在,您应该在Docker Hub的存储库列表中看到您的映像:

Click on it to reveal more details:

单击它以显示更多详细信息:

Now since the image is public, everyone can use it to create their own containers, or use it as a base image.

现在,由于图像是公开的,因此每个人都可以使用它来创建自己的容器,或将其用作基础图像。

You can now create a new tag, making a new version of the image, and there’s a lot more you can do that I won’t go into now, like:

现在,您可以创建一个新标签,以创建该图像的新版本,并且您可以做的很多事情我都不会涉及,例如:

  • automated builds of images from external repositories (like GitHub)

    从外部存储库(例如GitHub)自动构建图像
  • running automated tests

    运行自动化测试
  • setting up webhooks to perform any action when a repository image is updated

    设置Webhooks以在更新存储库映像时执行任何操作
  • creating organizations and teams within them

    在其中建立组织和团队

翻译自: https://flaviocopes.com/docker-hub/

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值