Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

dockerfile verify command fails when stage names are used in FROM #3880

Open
slmsbrhgn opened this issue Sep 15, 2024 · 0 comments · May be fixed by #3881
Open

dockerfile verify command fails when stage names are used in FROM #3880

slmsbrhgn opened this issue Sep 15, 2024 · 0 comments · May be fixed by #3881
Labels
bug Something isn't working

Comments

@slmsbrhgn
Copy link

Description

When a Dockerfile contains a FROM statement using a stage name instead of image, dockerfile verify fails because cosign tries to pull the stage name as if it was an image.

For example, using this Dockerfile:

FROM cgr.dev/chainguard/static:latest AS base_image
# some customization here
FROM base_image
ENTRYPOINT "/executable"

running cosign dockerfile verify Dockerfile --certificate-oidc-issuer=https://token.actions.githubusercontent.com --certificate-identity=https://github.com/chainguard-images/images/.github/workflows/release.yaml@refs/heads/main ends with an error:

Extracted image(s): cgr.dev/chainguard/static:latest, base_image
(...)
Error: GET https://index.docker.io/v2/library/base_image/manifests/latest: UNAUTHORIZED: authentication required; [map[Action:pull Class: Name:library/base_image Type:repository]]
main.go:69: error during command execution: GET https://index.docker.io/v2/library/base_image/manifests/latest: UNAUTHORIZED: authentication required; [map[Action:pull Class: Name:library/base_image Type:repository]]

Commenting out FROM base_image in Dockerfile makes it work.

Version

GitVersion:    v2.4.0
GitCommit:     b5e7dc123a272080f4af4554054797296271e902
GitTreeState:  clean
BuildDate:     2024-08-06T21:39:53Z
GoVersion:     go1.22.5
Compiler:      gc
Platform:      linux/amd64
@slmsbrhgn slmsbrhgn added the bug Something isn't working label Sep 15, 2024
@slmsbrhgn slmsbrhgn linked a pull request Sep 15, 2024 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant