docker仓库使用简介
1.docker 登陆后 push镜像到docker hub 中遇到unauthorized authentication required问题,
镜像分公有和私有,你pull的镜像是公有镜像,由docker hub来维护,那个地址对你来说只能做pull操作,不能做push操作,所以会提示没有权限。
你要push到你自己的镜像库中去。先要用tag修改下镜像的名字,也就是docker tag hello-world your_namespace/hello-world
docker push your_namespace/hello-world.
docker push your_namespace/hello-world.
比如我的hub的repo名为billdan, 并新新建了一个hello-world镜像则需要如下操作:
docker tag hello-world billdan/hello-world
docker push billdan/hello-world
2.新建自己的仓库:
sudo docker run -d -p 5000:5000 -v /apps/myRegistry:/tmp/registry --name localRegistry registry
推送本地镜像:
1) 给镜像重置repository: sudo docker tag docker.io/alpine 172.31.50.39:5000/alpine
2) 上传镜像:sudo docker push 172.31.50.39:5000/alpine
3. 查询私有仓库包含哪些镜像:
VirtualBox:~$ curl -X GET http://172.31.50.39:5000/v2/_catalog {"repositories":["alpine","redis"]}从上面命令可以看到仓库含有两个镜像:alpine 和redis
查询某一镜像包含哪些tag:
VirtualBox:~$ curl -X GET http://172.31.50.39:5000/v2/redis/tags/list {"name":"redis","tags":["alpine"]}本例查询镜像redis的tag
相关推荐
魅惑青花瓷 2020-11-11
yangkang 2020-11-09
MichaelJScofield 2020-11-06
TaoTaoFu 2020-11-06
liaochaowu 2020-11-16
ChlatZed 2020-11-11
lnkToKing 2020-10-29
ChlatZed 2020-10-27
ChlatZed 2020-10-13
时光流水 2020-09-23
yangkang 2020-09-23
changecan 2020-09-22
dusuanyun 2020-09-21
newisI 2020-09-01
liaochaowu 2020-09-14
ShangQuan0 2020-09-10
fearlessxjdx 2020-09-04
libra0 2020-09-02
ChlatZed 2020-08-23
王道革 2020-11-25
lihongtai 2020-11-09
xysoul 2020-11-03