仓库(Repository):集中存放镜像的地方,分为公共仓库和私有仓库; 注册服务器(Registry):存放仓库的具体服务器,一个注册服务器可以有多个仓库; 官方公共仓库
Docker Hub地址:[https://hub.docker.com/](https://hub.docker.com/);
Docker Hub 公共镜像市场
登录 - docker login
PS C:\Users\1314y> docker login -u 1314yjhPassword:Login Succeeded
退出 - docker logout
PS C:\Users\1314y> docker logoutRemoving login credentials for https://index.docker.io/v1/PS C:\Users\1314y>
搭建本地私有仓库
需要注意: “insecure-registries”: [ “192.168.1.237:5000” ],
使用 registry 镜像创建私有仓库
我测试用的 window 10 操作系统。ip 为:192.168.1.237。
# 创建私有仓库PS C:\Users\1314y> docker run -d -p 5000:5000 registry:2Unable to find image 'registry:2' locally2: Pulling from library/registry6a428f9f83b0: Already exists90cad49de35d: Pull completeb215d0b40846: Pull complete429305b6c15c: Pull complete6f7e10a4e907: Pull completeDigest: sha256:265d4a5ed8bf0df27d1107edb00b70e658ee9aa5acb3f37336c5a17db634481eStatus: Downloaded newer image for registry:27471723b188525f9a2f44df09749aa10fa6aaa6b16e0a3a40394025289a6a5fePS C:\Users\1314y> docker psCONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES7471723b1885 registry:2 "/entrypoint.sh /etc…" 9 seconds ago Up 8 seconds 0.0.0.0:5000->5000/tcp, :::5000->5000/tcp xenodochial_brattain# 准备镜像PS C:\Users\1314y> docker tag ubuntu:latest 192.168.1.237:5000/test_ubuntu:1.0.0.1PS C:\Users\1314y> docker images192.168.1.237:5000/test_ubuntu 1.0.0.1 597ce1600cf4 11 days ago 72.8MBubuntu latest 597ce1600cf4 11 days ago 72.8MB# 上传镜像PS C:\Users\1314y> docker push 192.168.1.237:5000/test_ubuntu:1.0.0.1# 下载PS C:\Users\1314y> docker pull 192.168.1.237:5000/test_ubuntu:1.0.0.1
