将码头港的形象推到dockerhub [英] pushing docker image to dockerhub

查看:133
本文介绍了将码头港的形象推到dockerhub的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我创建了我自己的docker文件(运行一个打印helloworld的shell脚本)。
图像是hellodocker,标签是mytag
我现在有:

I ve created my own docker file ( that runs a shell script which prints "helloworld"). The image is "hellodocker" and the tag is "mytag" I now have:

bash-3.2$ docker images
REPOSITORY          TAG                   IMAGE ID            CREATED                 VIRTUAL SIZE
hellodocker         mytag                 3514c8dc11a8        39 minutes ago      2.433 MB
busybox             buildroot-2013.08.1   d200959a3e91        10 weeks ago        2.489 MB
busybox             ubuntu-14.04          37fca75d01ff        10 weeks ago        5.609 MB
busybox             ubuntu-12.04          fd5373b3d938        10 weeks ago        5.455 MB
busybox             buildroot-2014.02     a9eb17255234        10 weeks ago        2.433 MB
busybox             latest                a9eb17255234        10 weeks ago        2.433 MB

docker ps -a
CONTAINER ID        IMAGE                       COMMAND                CREATED             STATUS                        PORTS               NAMES
97c29510069e        hellodocker:mytag           /bin/sh -c /Users/in   33 minutes ago                  Exited (127) 26 minutes ago                       happy_pasteur       
8d04a1385c24        hellodocker:mytag           /bin/sh -c /Users/in   37 minutes ago      Exited (127) 30 minutes ago                       mad_bell            
8998d61c0513        hellodocker:mytag           /bin/sh -c /Users/in   37 minutes ago      Exited (127) 30 minutes ago                       boring_thompson         
64314c304a29        hellodocker:mytag           /bin/sh -c /Users/in   37 minutes ago      Exited (127) 31 minutes ago                       sad_wilson          
8bc20e0555b8        hellodocker:mytag           /bin/sh -c /Users/in   38 minutes ago      Exited (127) 31 minutes ago                       sleepy_mayer        
97664a4ba870        hellodocker:mytag           .                      38 minutes ago                                                        kickass_poincare    
8bb752631cb6        busybox:buildroot-2014.02   /bin/echo Hello Doct   18 hours ago        Exited (0) 18 hours ago                           dreamy_kowalevski   
6aa66b55ca94        busybox:buildroot-2014.02   bash-3.2$ sudo docke   18 hours ago                                                          ecstatic_lovelace   
2cc657f65342        busybox:buildroot-2014.02   /bin/echo Hello Dock   18 hours ago        Exited (0) 18 hours ago                           dreamy_poincare 

如何将码头图像推送到dockerhub?我使用 docker push< myuserid> / hellodocker 。这会给出一个不会这样的id的错误。我失踪了什么感谢提前。

How do I push the docker image to dockerhub? I use docker push <myuserid>/hellodocker. This gives a 'no such id` error. What am I missing? Thanks in advance.

推荐答案

您需要将其标记为< myuser> / hellodocker 当你建立它,例如

You either need to tag it as <myuser>/hellodocker when you build it, e g

docker build -t <myuser>/hellodocker:mytag .

或创建绑定到同一图像的新标签,即

or create a new tag tied to the same image, i e

docker tag hellodocker:mytag <myuser>/hellodocker:mytag

这篇关于将码头港的形象推到dockerhub的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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