dockerboot2docker

pushing docker image to dockerhub


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 

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.


Solution

  • 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