Bitbucketpipe道。 无法指定windowsservercore泊坞窗图像

Bitbucket Pipelines允许(使用bitbucket-pipelines.yml )从Dockerhub指定一个自定义的docker镜像作为构build环境。 下一张图片被用作.NET Core的默认值:

 # You can specify a custom docker image from Dockerhub as your build environment image: microsoft/dotnet:onbuild 

但是,因为我需要Windows容器图像,我正在尝试将图像更改为“windowsservercore”。 基于微软/ dotnetdocker集线器的信息,我试过了

 image: microsoft/dotnet:1.0.0-windowsservercore-core 

 image: microsoft/dotnet:1.0.0-preview2-windowsservercore-sdk 

但图像尚未下载:

 + docker pull "microsoft/dotnet:1.0.0-windowsservercore-core" 1.0.0-windowsservercore-core: Pulling from microsoft/dotnet 1239394e5a8a: Pulling fs layer d90a2ac79ff2: Pulling fs layer cde3fa87b2c9: Pulling fs layer 9f60be4f8205: Pulling fs layer c4f6347ed968: Pulling fs layer 9f60be4f8205: Waiting c4f6347ed968: Waiting 1239394e5a8a: Retrying in 5 seconds d90a2ac79ff2: Verifying Checksum d90a2ac79ff2: Download complete cde3fa87b2c9: Verifying Checksum cde3fa87b2c9: Download complete 1239394e5a8a: Retrying in 4 seconds c4f6347ed968: Verifying Checksum c4f6347ed968: Download complete ... 1239394e5a8a: Retrying in 3 seconds 1239394e5a8a: Retrying in 2 seconds 1239394e5a8a: Retrying in 1 second 1239394e5a8a: Downloading unknown blob 

如果Bitbucketpipe道不支持运行Windows映像 ,您可能根本无法使用该映像…

您正在报告的错误是从不支持的主机提取windowsservercore或nanoserver映像时得到的错误。

另外,我的本地docker在运行pull的时候也是一样的。

 $ docker pull microsoft/dotnet:1.0.0-windowsservercore-core`. 1.0.0-windowsservercore-core: Pulling from microsoft/dotnet 1239394e5a8a: Downloading d90a2ac79ff2: Download complete cde3fa87b2c9: Download complete 9f60be4f8205: Download complete c4f6347ed968: Download complete unknown blob 

您可以通过1.0.0-windowsservercore-core标签清单上的registryAPI获得详细的外观:

 curl -i -H "Authorization: Bearer $TOKEN" https://index.docker.io/v2/microsoft/dotnet/manifests/1.0.0-windowsservercore-core HTTP/1.1 200 OK Content-Length: 4168 Content-Type: application/vnd.docker.distribution.manifest.v1+prettyjws Docker-Content-Digest: sha256:190e1596bf49b844f6fc3361bbedcd50c917079e5f9f305a1fe807ae4b66a6a7 Docker-Distribution-Api-Version: registry/2.0 Etag: "sha256:190e1596bf49b844f6fc3361bbedcd50c917079e5f9f305a1fe807ae4b66a6a7" Date: Sun, 07 Aug 2016 13:25:58 GMT Strict-Transport-Security: max-age=31536000 { "schemaVersion": 1, "name": "microsoft/dotnet", "tag": "1.0.0-windowsservercore-core", "architecture": "amd64", "fsLayers": [ { "blobSum": "sha256:9f60be4f8205c0d384e6af06d61e253141395d4ef7000d8bb34032d1cbd8ee98" }, { "blobSum": "sha256:cde3fa87b2c91c895014a6c83481b27ede659f502538c6ed416574a3abe5a7a2" }, { "blobSum": "sha256:d90a2ac79ff2c769b497fabddbd14ae8a66f8034dda53fd5781402ec58416989" }, { "blobSum": "sha256:1239394e5a8ab79fbd3b751dc5d98decf5886f14339958fdf5c1f96c89da58a7" } ], 

清单包括1239394e5a8 blob Docker无法检索。 然后运行该blob的GET返回404。

 curl -i -H "Authorization: Bearer $TOKEN" https://index.docker.io/v2/microsoft/dotnet/blobs/sha256:1239394e5a8ab79fbd3b751dc5d98decf5886f14339958fdf5c1f96c89da58a7 HTTP/1.1 404 Not Found Content-Type: application/json; charset=utf-8 Docker-Distribution-Api-Version: registry/2.0 Date: Sun, 07 Aug 2016 13:29:02 GMT Content-Length: 157 Strict-Transport-Security: max-age=31536000 {"errors":[{"code":"BLOB_UNKNOWN","message":"blob unknown to registry","detail":"sha256:1239394e5a8ab79fbd3b751dc5d98decf5886f14339958fdf5c1f96c89da58a7"}]} 

而其他blob返回通常的redirect到数据下载:

 curl -i -H "Authorization: Bearer $TOKEN" https://index.docker.io/v2/microsoft/dotnet/blobs/sha256:d90a2ac79ff2c769b497fabddbd14ae8a66f8034dda53fd5781402ec58416989 HTTP/1.1 307 Temporary Redirect Content-Type: application/octet-stream Docker-Distribution-Api-Version: registry/2.0 Location: https://dseasb33srnrn.cloudfront.net/registry-v2/docker/registry/v2/blobs/sha256/d9/d90a2ac79ff2c769b497fabddbd14ae8a66f8034dda53fd5781402ec58416989/data?Expires=1470577758&Signature=B6n1cC~fNwgeYYbA2w6peZOWM5RyV79OrBW-9nN2NdxpB60FC1sUe7e9I4kcA7Meq1SAG7z4P4gQiLvNfokHr8u0p3LTUQgk4JpqZPxqSPNtDWoSyjzyTN0sK3iZPhgxcNBVfddHyxgkAw7xb47zUg76RjZ5-O8QNl2YeEKeX24_&Key-Pair-Id=APKAJECH5M7VWIS5YZ6Q Date: Sun, 07 Aug 2016 13:29:18 GMT Content-Length: 432 Strict-Transport-Security: max-age=31536000 <a href="https://dseasb33srnrn.cloudfront.net/registry-v2/docker/registry/v2/blobs/sha256/d9/d90a2ac79ff2c769b497fabddbd14ae8a66f8034dda53fd5781402ec58416989/data?Expires=1470577758&amp;Signature=B6n1cC~fNwgeYYbA2w6peZOWM5RyV79OrBW-9nN2NdxpB60FC1sUe7e9I4kcA7Meq1SAG7z4P4gQiLvNfokHr8u0p3LTUQgk4JpqZPxqSPNtDWoSyjzyTN0sK3iZPhgxcNBVfddHyxgkAw7xb47zUg76RjZ5-O8QNl2YeEKeX24_&amp;Key-Pair-Id=APKAJECH5M7VWIS5YZ6Q">Temporary Redirect</a>. 

这可能是一个registry错​​误,MS dotnet团队可能需要重build该图层/图像,然后重新发布以解决该问题 。 一旦他们解决了这个问题,你会发现Bitbucketpipe道是否可以运行Windows映像(我发现没有证据表明他们还在)。

我能够通过使用mono泊坞窗图像和xbuild来解决这个问题。