利用最新的Registry去搭建Docker私有仓库,但是在推送镜像的时候出现
C:\Users\Administrator>docker tag microsoft/iis 192.168.2.30:5000/iis
C:\Users\Administrator>docker push 192.168.2.30:5000/iis
The push refers to a repository [192.168.2.30:5000/iis]
780cc29d7c04: Pushed
ce15af77227d: Pushed
357bccc34a53: Pushed
591455288d2b: Layer already exists
3543301c85cf: Skipped foreign layer
f358be10862c: Skipped foreign layer
latest: digest: sha256:87a2af3e29845ada74286a30e0002d17f75b57675056385de404f9c3784a9d3e size: 1783
经过最后发现https://github.com/moby/moby/issues/27580
原来是微软公司设置的发行策略,主要是法律及版权控制
上面可以看出,你可以推送自己构建的层,但是无法推送基础层。
3543301c85cf: Skipped foreign layer
f358be10862c: Skipped foreign layer
有一个debug说明的很清楚:
Docker pull xxx.xxx.xxx.xxx:5000/windowsservercore ( docker registry)
time="2016-11-21T08:45:42.009251300-08:00" level=debug msg="pulling blob "sha256:d33fff6043a134da85e10360f9932543f1dfc0c3a22e1edd062aa9b088a86c5b""
time="2016-11-21T08:45:42.009251300-08:00" level=debug msg="pulling blob "sha256:9c7f9c7d9bc2915388ecc5d08e89a7583658285469d7325281f95d8ee279cc60""
time="2016-11-21T08:45:42.010254400-08:00" level=debug msg="Pulling sha256:d33fff6043a134da85e10360f9932543f1dfc0c3a22e1edd062aa9b088a86c5b from foreign URLhttps://go.microsoft.com/fwlink/?linkid=834677"
time="2016-11-21T08:45:42.012253300-08:00" level=debug msg="Pulling sha256:9c7f9c7d9bc2915388ecc5d08e89a7583658285469d7325281f95d8ee279cc60 from foreign URLhttps://go.microsoft.com/fwlink/?linkid=830340"
time="2016-11-21T08:54:53.022940200-08:00" level=debug msg="Downloaded d33fff6043a1 to tempfile C:\Users\ADMINI~1\AppData\Local\Temp\2\GetImageBlob260816119"
It detects the foreign layers and pulls the blob & image from Microsoft site, it defeats the purpose of registry
这里就很清楚了,forign layer都是来自于https://go.microsoft.com/fwlink/?linkid=834677以及https://go.microsoft.com/fwlink/?linkid=830340
重点:所以出现这种情况就是说无法推送外层,推送至私有仓库会被忽略,但是可以通过docker pull镜像进行下载,这样就有一个问题就是所有使用这个镜像的客户端必须要可以上网