简体   繁体   English

Docker将映像推送到Hub

[英]Docker push image to Hub

I have modified, added some extra applications to a running container, now I would like to push it to Docker Hub. 我已经修改了一些新应用程序,并将其添加到正在运行的容器中,现在我想将其推送到Docker Hub。 I have tagged my image like this: docker tag hellodocker:mytag <myuser>/hellodocker:mytag Pushing process was succesful, but after pull and run I see, that it contains only the base image, that I have used up, so intalled applications haven't "commited". 我已经像这样标记了我的映像docker tag hellodocker:mytag <myuser>/hellodocker:mytag推送过程成功完成,但是在拉动并运行后,我看到它仅包含已用完的基本映像,因此安装了应用程序还没有“承诺”。

It seems that you haven't done commit of your container. 看来您尚未完成容器的提交。 In order to do this - you have to execute the following command: 为此,您必须执行以下命令:

docker commit CONTAINER_ID CONTAINER_NAME

more on this: Docker commit 有关此内容的更多信息: Docker commit

OR 要么

You could simply execute docker command and see its output: 您可以简单地执行docker命令并查看其输出:

...
commit    Create a new image from a container's changes
...

1) First login by typing sudo docker login in the terminal. 1)首先在终端中输入sudo docker login Enter username and password 输入用户名和密码

2) Visit your docker account and create a new repository. 2)访问您的Docker帐户并创建一个新的存储库。 In my case I created a repository zawad1879/dockerhub 就我而言,我创建了一个存储库zawad1879 / dockerhub

3)Say you have a docker image with repository name: zawad/django and tag: latest . 3)如果你有仓库名码头工人形象:zawad / Django和标签: 最新的

In that case you will need to tag this image with a label of your wish. 在这种情况下,您将需要使用您希望的标签来标记该图像。 I decided to tag it with the label: myfirstimagepush . 我决定将其标签为: myfirstimagepush You tag the image by typing the command 您通过键入命令标记图像

sudo docker tag zawad/django:latest zawad1879/dockerhub:firstimagepush

4) Finally push the image to your repo using the command 4)最后使用命令将图像推送到您的仓库

sudo docker push zawad1879/dockerhub:firstimagepush

That's all there is to it. 这里的所有都是它的。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM