天天看點

往dockerhub上上傳鏡像

往dockerhub上上傳鏡像

一、首先注冊一個賬号

https://hub.docker.com/
           

然後點選Create->Create Repository

輸入自己的賬号名,然後在設定倉庫名

如使用者名:wangzhenwei , 倉庫名:its

二、然後給本地鏡像打标簽:

[root@helloword tomcat7+jdk8]# docker images
REPOSITORY          TAG                 IMAGE ID            CREATED             SIZE
its-image-base      1.0                 a4c75a448942        3 minutes ago       762MB
           

打标簽:

[root@helloword tomcat7+jdk8]# docker tag its-image-base:1.0 wangzhenwei/its-image-base:v1.0
[root@helloword tomcat7+jdk8]# docker images
REPOSITORY                   TAG                 IMAGE ID            CREATED             SIZE
its-image-base               1.0                 a4c75a448942        3 minutes ago       762MB
wangzhenwei/its-image-base   v1.0                a4c75a448942        3 minutes ago       762MB
           

三、登陸docker

[root@helloword tomcat7+jdk8]# 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: wangzhenwei
Password:
Login Succeeded
           

四、上傳鏡像

docker push wangzhenwei/its-image-base:v1.0
           

五、登陸搜尋

https://hub.docker.com/r/wangzhenwei/its-image-base/
           

為什麼要把基礎鏡像上傳?

如果應用docker化之後,會有一個問題非常麻煩,就是鏡像倉庫問題。

會發現應用更新部署,所有的時間,都壓在帶寬上。

關于如何制作私庫、如何提高鏡像下載下傳的效率,可以看後面的文章。