文章目录
看这里:
戳此链接 通往 关于 Docker 所有的学习文章 !
前言:
docker镜像仓库,顾名思义 是存放镜像的,你可以创建自己的镜像仓库,来存放自己定义好的镜像,方便以后再 pull 下镜像!
当你要 push 镜像到 镜像仓库的时候,你需要 使用 docker login 来登录镜像仓库!当然 退出登录的话就是:docker logout !
本章只讲 公网环境下的 docker 镜像仓库,当然也有局域网环境下的 Docker 镜像仓库:Harbor ,下一章讲:
1、登录 Docker Hub :
网不好慢炸了!!! 还是推荐国内阿里云的吧!
①、注册 或 登录 Docker Hub:
Docker Hub 地址: https://hub.docker.com/
有账号 —— sign in (登录)
无账号 —— 输入 用户名 + 密码 + 人机验证 + sign up (注册)
( 不想搞了,网慢炸了!!!)
转了n久的圈圈!心态崩了!
反正就是你注册以后,创建仓库啊等等这些,然后创建好以后,返回系统命令行,登录 docker hub !
root@zhengzelin:~# 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:
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
# 上面提示你了,默认登录的就是 Docker Hub ;
找到以前的图了,将就用吧,毕竟现在没法登录 docker hub!
②、创建储存库:
注意:你的仓库名 最好 和你这个仓库存放的镜像有关!
eg:加入你放的镜像是 ubuntu 各个版本的镜像,(ubuntu 16.04 、ubuntu 18.04…); 你的仓库名就可以