sigstore / cosign

Code signing and transparency for containers and binaries
Apache License 2.0
4.48k stars 547 forks source link

docker build fails - error pulling image cgr.dev/chainguard/static:latest #2983

Closed rohanshetty-bh closed 1 year ago

rohanshetty-bh commented 1 year ago

I am trying to build cosign image using the following documented dockerfile Reference Link: https://github.com/sigstore/cosign#dockerfile

FROM gcr.io/projectsigstore/cosign:v1.13.0 as cosign-bin

Source: https://github.com/chainguard-images/static

FROM cgr.dev/chainguard/static:latest COPY --from=cosign-bin /ko-app/cosign /usr/local/bin/cosign ENTRYPOINT [ "cosign" ]

However, docker build fails at stp 2 Step 2/4 : FROM cgr.dev/chainguard/static:latest

Error: error pulling image configuration: download failed after attempts=6: read tcp 10.77.81.205:37550->104.18.8.90:443: read: connection reset by peer

Please advice.

cpanato commented 1 year ago

I just tried and worked

$ docker pull cgr.dev/chainguard/static:latest
latest: Pulling from chainguard/static
f2fe506805bb: Pull complete
Digest: sha256:1888f4db2c92e5a3e1b81952d8727e63c1b5b87ad3df374de318999beb4fd194
Status: Downloaded newer image for cgr.dev/chainguard/static:latest
cgr.dev/chainguard/static:latest
cpanato commented 1 year ago

and using the dockerfile

FROM gcr.io/projectsigstore/cosign:v1.13.0 as cosign-bin

# Source: https://github.com/chainguard-images/static
FROM cgr.dev/chainguard/static:latest
COPY --from=cosign-bin /ko-app/cosign /usr/local/bin/cosign
ENTRYPOINT [ "cosign" ]
$ docker build --load -t ctadeu/test .
[+] Building 14.2s (9/9) FINISHED
 => [internal] load .dockerignore                                                                                                                                                                                                                                                                                                                                                                                                                                                                    0.0s
 => => transferring context: 2B                                                                                                                                                                                                                                                                                                                                                                                                                                                                      0.0s
 => [internal] load build definition from Dockerfile                                                                                                                                                                                                                                                                                                                                                                                                                                                 0.0s
 => => transferring dockerfile: 274B                                                                                                                                                                                                                                                                                                                                                                                                                                                                 0.0s
 => [internal] load metadata for cgr.dev/chainguard/static:latest                                                                                                                                                                                                                                                                                                                                                                                                                                    2.8s
 => [internal] load metadata for gcr.io/projectsigstore/cosign:v1.13.0                                                                                                                                                                                                                                                                                                                                                                                                                               1.8s
 => [cosign-bin 1/1] FROM gcr.io/projectsigstore/cosign:v1.13.0@sha256:398f441c46e58906dc6d3aaaad22fe63f018dc30acbe13b326e5a016e711301c                                                                                                                                                                                                                                                                                                                                                              8.4s
 => => resolve gcr.io/projectsigstore/cosign:v1.13.0@sha256:398f441c46e58906dc6d3aaaad22fe63f018dc30acbe13b326e5a016e711301c                                                                                                                                                                                                                                                                                                                                                                         0.0s
 => => sha256:150f49498aef0b43c07f7612aac0ef661fa50960061af7dd5ebda6f98efb8e2a 40.30MB / 40.30MB                                                                                                                                                                                                                                                                                                                                                                                                     8.0s
 => => sha256:250c06f7c38e52dc77e5c7586c3e40280dc7ff9bb9007c396e06d96736cf8542 127B / 127B                                                                                                                                                                                                                                                                                                                                                                                                           0.5s
 => => sha256:ad949017a624c0975221804078fd57a60c2da2269a14eec4eccb9b7803a99f12 769.52kB / 769.52kB                                                                                                                                                                                                                                                                                                                                                                                                   0.8s
 => => sha256:f7cbc5ea5f8675be2357a6b6915b69d73f9ab94941d02f90ead5ae9421eeaaa3 801.34kB / 801.34kB                                                                                                                                                                                                                                                                                                                                                                                                   0.8s
 => => sha256:76e2fac4fe7cf48a0a40efb8b59ec980ff4a5641b3bfefc3310ef410c4570620 7.07MB / 7.07MB                                                                                                                                                                                                                                                                                                                                                                                                       2.2s
 => => extracting sha256:f7cbc5ea5f8675be2357a6b6915b69d73f9ab94941d02f90ead5ae9421eeaaa3                                                                                                                                                                                                                                                                                                                                                                                                            0.1s
 => => extracting sha256:76e2fac4fe7cf48a0a40efb8b59ec980ff4a5641b3bfefc3310ef410c4570620                                                                                                                                                                                                                                                                                                                                                                                                            0.1s
 => => extracting sha256:ad949017a624c0975221804078fd57a60c2da2269a14eec4eccb9b7803a99f12                                                                                                                                                                                                                                                                                                                                                                                                            0.0s
 => => extracting sha256:250c06f7c38e52dc77e5c7586c3e40280dc7ff9bb9007c396e06d96736cf8542                                                                                                                                                                                                                                                                                                                                                                                                            0.0s
 => => extracting sha256:150f49498aef0b43c07f7612aac0ef661fa50960061af7dd5ebda6f98efb8e2a                                                                                                                                                                                                                                                                                                                                                                                                            0.3s
 => [stage-1 1/2] FROM cgr.dev/chainguard/static:latest@sha256:1888f4db2c92e5a3e1b81952d8727e63c1b5b87ad3df374de318999beb4fd194                                                                                                                                                                                                                                                                                                                                                                      2.2s
 => => resolve cgr.dev/chainguard/static:latest@sha256:1888f4db2c92e5a3e1b81952d8727e63c1b5b87ad3df374de318999beb4fd194                                                                                                                                                                                                                                                                                                                                                                              0.0s
 => => sha256:f2fe506805bb284d974cb241982c814b34d7d0e7bea0abdf0ed9c970c0115679 609.90kB / 609.90kB                                                                                                                                                                                                                                                                                                                                                                                                   2.1s
 => => extracting sha256:f2fe506805bb284d974cb241982c814b34d7d0e7bea0abdf0ed9c970c0115679                                                                                                                                                                                                                                                                                                                                                                                                            0.1s
 => [stage-1 2/2] COPY --from=cosign-bin /ko-app/cosign /usr/local/bin/cosign                                                                                                                                                                                                                                                                                                                                                                                                                        0.2s
 => exporting to docker image format                                                                                                                                                                                                                                                                                                                                                                                                                                                                 2.8s
 => => exporting layers                                                                                                                                                                                                                                                                                                                                                                                                                                                                              1.9s
 => => exporting manifest sha256:0e0b9fb595250c05ebc62b3d783f310bf56ee249feab12f636a7f59a81ce4060                                                                                                                                                                                                                                                                                                                                                                                                    0.0s
 => => exporting config sha256:0dc9132aa3da2b227aa24188863c09b5450bcc64a420a99d4d2dbccc4e3b148d                                                                                                                                                                                                                                                                                                                                                                                                      0.0s
 => => sending tarball                                                                                                                                                                                                                                                                                                                                                                                                                                                                               0.9s
 => importing to docker
rohanshetty-bh commented 1 year ago

Thanks for the quick response.

I am trying to build image via our Jenkins Server which is hosted in our corporate network and still getting the same error error pulling image configuration: download failed after attempts=6: read tcp 10.77.81.205:37170->104.18.8.90:443: read: connection reset by peer

probably, some port is blocking to pull this docker image.

I am trying to integrate Cosign as a step in our Jenkins Pipeline. So you guys have any recommendation or Jenkins pipeline code snippet which i can refer?

cpanato commented 1 year ago

looks like it is a network issue on your side. I dont know what you are trying to do, but maybe you can just use the cosign image or prebuilt an image with all things you need in that and use it. maybe you can use the plain gcr.io/projectsigstore/cosign image, is that work for you?

patflynn commented 1 year ago

possibly related? https://github.com/chainguard-images/images/discussions/545

github-actions[bot] commented 1 year ago

This issue is stale because it has been open 60 days with no activity. Remove stale label or comment or this will be closed in 5 days.

github-actions[bot] commented 1 year ago

This issue was closed because it has been stalled for 5 days with no activity.