码迷,mamicode.com
首页 > Web开发 > 详细

Docker 镜像文件的上传

时间:2018-05-27 22:47:15      阅读:341      评论:0      收藏:0      [点我收藏+]

标签: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 镜像文件的上传

标签:Docker镜像上传DokcerHub

原文地址:http://blog.51cto.com/aishangwei/2120824

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!