本文共 2093 字,大约阅读时间需要 6 分钟。
An image like the one we created in the 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.
像我们在创建的图像一样简单,但它是尝试通过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
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/ docker push /
If you forget to login, you will get a
denied: requested access to the resource is denied
error message when you rundocker 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:
现在,您可以创建一个新标签,以创建该图像的新版本,并且您可以做的很多事情我都不会涉及,例如:
翻译自:
转载地址:http://jxmgb.baihongyu.com/