Docker 鏡像文件的上傳
阿新 • • 發佈:2018-05-28
Docker鏡像上傳DokcerHub制作一個去鏡像,然後把它上傳到hub.docker.com上去
(1)登入到以下網址,註冊一個帳戶名稱
https://hub.docker.com/
(2)在Docker主機上進行登陸
[root@c720120 docker]# 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: mike0405 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
(3)然後把我們登錄的憑據存入了以下位置。
[root@c720120 .docker]# pwd /root/.docker [root@c720120 .docker]# cat config.json { "auths": { "https://index.docker.io/v1/": { "auth": "bWlrZTA0MDU6emFuZzA0MDVaQU5H" } }, "HttpHeaders": { "User-Agent": "Docker-Client/18.05.0-ce (linux)" }
(4)制作鏡像並上傳
[root@c720120 .docker]# docker tag flask mike0405/flask [root@c720120 .docker]# docker push mike0405/flask The push refers to repository [docker.io/mike0405/flask] 7ac180ee56ec: Pushed 7ac2d207ee3f: Pushed c0cb3173d025: Pushed d2e086cfb9ca: Pushed 7861eaf542d8: Pushed 6948ed269722: Pushed 4622c8e1bdc0: Pushed b33859b66bfd: Pushed 14fa4a9494bf: Pushed 0c3819952093: Pushed 05b0f7f2a817: Pushed latest: digest: sha256:bf314bbc4e3fa98f80cb964e750d58e1f47b361525fe780b1a3803eb5099e2ef size: 2619
(5)從以下圖中,可以看到步驟4的上傳已經成功了。
(6)鏡像搜索使用search選項
例:[root@c720120 .docker]# docker search postgres
NAME DESCRIPTION STARS OFFICIAL AUTOMATED
postgres The PostgreSQL object-relational database sy… 4979 [OK]
sameersbn/postgresql 130 [OK]
paintedfox/postgresql A docker image for running Postgresql. 77 [OK]
orchardup/postgresql https://github.com/orchardup/docker-postgres… 44 [OK]
kiasaki/alpine-postgres PostgreSQL docker image based on Alpine Linux 41 [OK]
centos/postgresql-96-centos7 PostgreSQL is an advanced Object-Relational … 19
bitnami/postgresql Bitnami PostgreSQL Docker Image 18 [OK]
begriffs/postgrest Moved to https://hub.docker.com/r/postgrest/… 16 [OK]
centos/postgresql-94-centos7 PostgreSQL is an advanced Object-Relational … 15
crunchydata/crunchy-postgres Crunchy PostgreSQL is an open source, unmodi… 11
wrouesnel/postgres_exporter Postgres metrics exporter for Prometheus. 8
clkao/postgres-plv8 Docker image for running PLV8 1.4 on Postgre… 7 [OK]
Docker 鏡像文件的上傳