commit and push a docker image to Docker Hub

  1. sign up on Docker Hub to get your user id and password
  2. pull a image from Docker Hub
    docker pull ubuntu
  3. make a dir on ubuntu image and commit/push image
    docker images
    docker run -it -d ubuntu
    docker ps -a
    root@ubunu2004:~# docker exec -it 6e08ac7cc702 bash
    root@6e08ac7cc702:/# mkdir /test_dir
    root@6e08ac7cc702:/# exit
    exit
    docker commit 6e08ac7cc702 zhuby1973/ubuntu:1
    root@ubunu2004:~# docker login
    Login with your Docker ID to push and pull images from Docker Hub. If you don't have a Docker ID, head over to https://hub.docker.com to create one.
    Username: zhuby1973
    Password:
    WARNING! Your password will be stored unencrypted in /root/.docker/config.json.
    Configure a credential helper to remove this warning. See
    https://docs.docker.com/engine/reference/commandline/login/#credentials-store
    Login Succeeded
    root@ubunu2004:~# docker push zhuby1973/ubuntu:1
    The push refers to repository [docker.io/zhuby1973/ubuntu]
    d3d28de77691: Pushed
    544a70a875fc: Mounted from library/ubuntu
    cf0f3facc4a3: Mounted from library/ubuntu
    132bcd1e0eb5: Mounted from library/ubuntu
    d22cfd6a8b16: Mounted from library/ubuntu
    2: digest: sha256:4c50ab7b0f8cadd72f5d37a569795a4ba697be892fca1b36a96eb9aa49a59d2e size: 1359
  4. logon https://hub.docker.com/repositories you will find zhuby1973/ubuntu already there!
  5. you can start this container to verify
    
    root@ubunu2004:~# docker run -it -d zhuby1973/ubuntu:1
    e5477e45b6b2bfe330e9f37a6f74e90964ef887f0f0a37ae23bbae4319a465a1
    root@ubunu2004:~# docker ps
    CONTAINER ID        IMAGE                COMMAND             CREATED             STATUS              PORTS               NAMES
    e5477e45b6b2        zhuby1973/ubuntu:1   "/bin/bash"         26 seconds ago      Up 24 seconds                           vigilant_satoshi
    df78087a8ef1        zhuby1973/test:2     "/bin/bash"         17 minutes ago      Up 17 minutes                           charming_wiles
    6e08ac7cc702        ubuntu               "/bin/bash"         32 minutes ago      Up 32 minutes                           charming_goodall
    root@ubunu2004:~# docker exec -it e5477e45b6b2 bash
    root@e5477e45b6b2:/# ls -ltr /test-dir
    total 0

55 Replies to “commit and push a docker image to Docker Hub”

  1. Hiya, I am really glad I’ve found this info. Nowadays bloggers publish only about gossips and net
    and this is really frustrating. A good website with exciting content, this
    is what I need. Thank you for keeping this website, I’ll be visiting it.
    Do you do newsletters? Can’t find it.

    my blog … Pellamore Reviews

  2. Does your blog have a contact page? I’m having a tough
    time locating it but, I’d like to shoot you an email. I’ve got some suggestions for your blog
    you might be interested in hearing. Either way,
    great site and I look forward to seeing it expand over time.

  3. Pretty nice post. I simply stumbled upon your weblog and wanted to say that I have truly
    loved surfing around your weblog posts. After all I’ll be subscribing in your feed and I’m hoping you write again very
    soon!

  4. You really make it appear so easy together with your presentation but
    I find this topic to be really something which I think I might never understand.

    It kind of feels too complex and very wide for me.

    I’m having a look ahead on your subsequent put up, I will try
    to get the hang of it!

  5. Hi my family member! I wish to say that this article is awesome, great written and come with
    almost all significant infos. I’d like to see more posts like this .

  6. Hello there I am so excited I found your weblog, I really found
    you by mistake, while I was browsing on Aol for something else, Anyways I am here now and would just like to say thanks for a tremendous post
    and a all round thrilling blog (I also love the
    theme/design), I don’t have time to look over it all at the minute but I have saved it and also included your RSS
    feeds, so when I have time I will be back to read a lot more, Please do keep up the great b.

  7. I got this web site from my pal who informed me on the topic of this
    website and at the moment this time I am browsing this
    web site and reading very informative articles or reviews
    here.

  8. I have been exploring for a little for any high-quality articles or blog posts on this kind
    of space . Exploring in Yahoo I at last stumbled upon this
    site. Studying this info So i am satisfied
    to show that I’ve an incredibly just right uncanny
    feeling I came upon just what I needed. I most undoubtedly will make certain to don?t put out of your
    mind this web site and provides it a look regularly.

  9. After going over a handful of the blog articles on your web site, I truly
    appreciate your way of writing a blog. I added it to my bookmark webpage
    list and will be checking back soon. Please visit my web site too and let me know how you feel.

  10. I do agree with all the ideas you’ve offered for your post.

    They’re really convincing and will certainly work. Nonetheless,
    the posts are too short for starters. Could you please lengthen them a
    little from subsequent time? Thanks for the post.

  11. An outstanding share! I have just forwarded this onto a co-worker who has been conducting a little research on this.
    And he actually bought me dinner simply because I
    discovered it for him… lol. So let me reword this….
    Thanks for the meal!! But yeah, thanx for
    spending some time to discuss this issue here
    on your site.

  12. I really love your blog.. Very nice colors & theme. Did you develop this web site yourself?

    Please reply back as I’m attempting to create my very own website and would like to know
    where you got this from or just what the theme is named.

    Thank you!

  13. Hello there, just became alert to your blog through Google, and found that it’s really informative.
    I am going to watch out for brussels. I’ll be grateful
    if you continue this in future. Many people will be benefited from
    your writing. Cheers!

  14. Its like you read my mind! You appear to know so much about this, like you wrote the book in it or something.
    I think that you can do with a few pics to drive the message home
    a bit, but other than that, this is excellent blog.
    A fantastic read. I will certainly be back.

  15. I’m not sure where you’re getting your info, but
    good topic. I needs to spend some time learning much
    more or understanding more. Thanks for fantastic information I was looking
    for this information for my mission.

  16. Normally I do not read article on blogs, however
    I would like to say that this write-up very pressured me to
    try and do it! Your writing style has been surprised me.
    Thanks, quite nice post.

  17. Great – I should definitely pronounce, impressed with your site.
    I had no trouble navigating through all the tabs and related
    info ended up being truly simple to do to access. I recently found
    what I hoped for before you know it in the least.
    Reasonably unusual. Is likely to appreciate it for those who add forums or
    something, website theme . a tones way for your client to communicate.
    Excellent task.

    Check out my web page – Xtreme Shred

  18. I do consider all of the ideas you’ve introduced on your post.
    They’re very convincing and can certainly work.
    Still, the posts are too short for newbies. Could
    you please lengthen them a little from next time? Thank
    you for the post.

  19. Hey! Someone in my Myspace group shared this site with us so I came
    to check it out. I’m definitely loving the information. I’m bookmarking and will be tweeting this to my followers!

    Excellent blog and wonderful style and design.

  20. Magnificent goods from you, man. I’ve take note your stuff prior to and you are simply
    extremely fantastic. I actually like what you’ve got here, certainly like what you are stating and the best way through which you say it.
    You are making it enjoyable and you still care for
    to stay it sensible. I can not wait to read much more from you.
    This is really a terrific website.

  21. Just want to say your article is as astounding. The clearness in your post is just nice and i
    can assume you’re an expert on this subject.
    Fine with your permission allow me to grab your RSS
    feed to keep updated with forthcoming post. Thanks a million and please continue the enjoyable work.

  22. I blog frequently and I genuinely thank you for your content.
    Your article has truly peaked my interest. I will book mark your site and keep checking for new information about once per week.
    I opted in for your Feed too.

Leave a Reply

Your email address will not be published. Required fields are marked *