Bitbucket管道。无法指定windowsservercore docker镜像

时间:2016-08-07 11:50:58

标签: docker .net-core bitbucket-pipelines

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

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

但是因为我需要Windows Containers图像,我正在尝试将图像更改为" windowsservercore"。基于microsoft/dotnet docker hub中的信息,我试过了

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

2 个答案:

答案 0 :(得分:2)

如果Bitbucket管道doesn't support running Windows images yet ...

,您可能根本无法使用该图像
  

您报告的错误是从不受支持的主机中提取windowsservercore或nanoserver图像时出现的错误。

此外,我的本地泊坞窗在运行拉动时也会这样做。

$ 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标签清单上的注册表API查看详细信息:

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"
      }
   ],

清单包含Docker无法检索的1239394e5a8 blob。然后为该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将通常的重定向返回到数据下载:

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>.

这可能是一个注册表错​​误,MS dotnet团队可能需要重建该图层/图像并再次发布以解决issue问题。一旦他们修复了你就会发现Bitbucket管道是否可以运行Windows映像(我发现没有证据表明他们还没有)。

答案 1 :(得分:0)

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