栏目分类:
子分类:
返回
名师互学网用户登录
快速导航关闭
当前搜索
当前分类
子分类
实用工具
热门搜索
名师互学网 > IT > 系统运维 > 运维 > Linux

上传镜像到DockerHub

Linux 更新时间: 发布时间: IT归档 最新发布 模块sitemap 名妆网 法律咨询 聚返吧 英语巴士网 伯小乐 网商动力

上传镜像到DockerHub

如果本地build的镜像需要共享的时候,就需要把镜像推送到镜像仓库,供其他人下载使用。

dockerHub就是这么一个东西。你可以将你的镜像设置为私有或者公有。

上传步骤

1、登录到dockerhub

docker 提供了客户端命令可以登录

[root@hadoop100 ~]#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: ninesun0318
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

2、给本地的镜像打一个tag

~]#docker tag 605c77e624dd ninesun0318/nginx-test

请注意两个镜像ID 是完全一样的 

3、docker push 推送远端 

 ]#docker push ninesun0318/nginx-test:latest

 4、在dockerhub上查看.

5、使用完之后退出dockerhub

为了安全起见使用完应该退出,避免被hacker推送一些私密镜像到仓库

[root@hadoop101 qms]# docker logout
Removing login credentials for https://index.docker.io/v1/
 

转载请注明:文章转载自 www.mshxw.com
本文地址:https://www.mshxw.com/it/757024.html
我们一直用心在做
关于我们 文章归档 网站地图 联系我们

版权所有 (c)2021-2022 MSHXW.COM

ICP备案号:晋ICP备2021003244-6号