LEN

Contos7 Docker 推送到 Docker Hub
向Docker Hub上推送必须要在该网站上进行注册,在需要推送的机器上使用下面的命令进行登录。Docker lo...
扫描右侧二维码阅读全文
16
2017/01

Contos7 Docker 推送到 Docker Hub

向Docker Hub上推送必须要在该网站上进行注册,在需要推送的机器上使用下面的命令进行登录。Docker login进行登录:

[root@bogon ~]# 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
Username (libenfu): libenfu
Password: 
Login Succeeded

登录的认证信息存放在 ~/.docker/config.json

[root@bogon .docker]# pwd
/root/.docker
[root@bogon .docker]# ls
config.json
[root@bogon .docker]# cat config.json 
{
    "auths": {
        "https://index.docker.io/v1/": {
            "auth": "bGliZW5mdToxOTkyNDE5Lg=="
        }
    }
}

查看 本地镜像


[root@bogon ~]# docker images;
REPOSITORY          TAG                 IMAGE ID            CREATED             SIZE
test/redis          v1.1                ff0c17488cd3        3 hours ago         180.1 MB
nginx               v2                  bcc698830f64        19 hours ago        181.6 MB
mysql               latest              0e7ce207390e        2 days ago          400.1 MB
hello-world         latest              48b5124b2768        2 days ago          1.84 kB
mongo               3.2                 7c0338364846        2 days ago          342.8 MB
nginx               latest              01f818af747d        2 weeks ago         181.6 MB
centos              latest              67591570dd29        4 weeks ago         191.8 MB
redis               latest              d59dc9e6d0bf        4 weeks ago         182.9 MB
libenfu/lnmp        latest              d59dc9e6d0bf        4 weeks ago         182.9 MB

docker 容器打一个tag

[root@bogon .docker]# docker tag redis libenfu/lnmp

将镜像推送到Docker Hub

[root@bogon .docker]# docker push libenfu/lnmp:latest
The push refers to a repository [docker.io/libenfu/lnmp]
eae6e471b603: Mounted from library/redis 
c418a51fc081: Pushed 
5b0e63da2fb4: Mounted from library/redis 
86726b2a83fc: Mounted from library/redis 
41829a143bcc: Mounted from library/redis 
afbfb84fad8a: Mounted from library/redis 
b6ca02dfe5e6: Pushing [===============================>                   ]    77 MB/123 MB
b6ca02dfe5e6: Preparing 

b6ca02dfe5e6: Pushing [===============================>                   ] 78.61 MB/123 MB

b6ca02dfe5e6: Pushing [======================================>            ] 94.28 MB/123 MB

b6ca02dfe5e6: Pushed 

latest: digest: sha256:eed4da4937cb562e9005f3c66eb8c3abc14bb95ad497c03dc89d66bcd172fc7f size: 1783
最后修改:2017 年 02 月 08 日 02 : 56 PM
如果觉得我的文章对你有用,请随意赞赏

发表评论