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

Kaniko fails to pull from GCR in Gitlab #3328

Open
jgsuess opened this issue Oct 2, 2024 · 0 comments
Open

Kaniko fails to pull from GCR in Gitlab #3328

jgsuess opened this issue Oct 2, 2024 · 0 comments

Comments

@jgsuess
Copy link

jgsuess commented Oct 2, 2024

Actual behavior

In gitlab, kaniko obtains the manifest of an image, but fails to obtain the image from GCR.

Expected behavior
In gitlab, kaniko obtains the image from GCR.

To Reproduce
Steps to reproduce the behavior:

  1. In a Gitlab repository, create the files below.
  2. Observe build failure
build:
  stage: build
  image:
    name: gcr.io/kaniko-project/executor:v1.23.2-debug
    entrypoint: [""]
  script:
     - /kaniko/executor
      --context "${CI_PROJECT_DIR}"
      --dockerfile "${CI_PROJECT_DIR}/Dockerfile"
      --destination "${CI_REGISTRY_IMAGE}:${CI_COMMIT_TAG}"
FROM gcr.io/distroless/java17-debian12:nonroot

Additional Information

  • Dockerfile
    Please provide either the Dockerfile you're trying to build or one that can reproduce this error.
  • Build Context
    Please provide or clearly describe any files needed to build the Dockerfile (ADD/COPY commands)
  • Kaniko Image (fully qualified with digest)
Using docker image sha256:16b383e1c3b259d59f75a2720a45ccf15b3a716cef44c6a5c521ceb471117168 for gcr.io/kaniko-project/executor:v1.23.2-debug with digest gcr.io/kaniko-project/executor@sha256:c3109d5926a997b100c4343944e06c6b30a6804b2f9abe0994d3de6ef92b028e ...
$ /kaniko/executor --context "${CI_PROJECT_DIR}" --dockerfile "${CI_PROJECT_DIR}/Dockerfile" --destination "${CI_REGISTRY_IMAGE}:${CI_COMMIT_TAG}"
INFO[0000] Using dockerignore file: /builds/australian-e-health-research-centre/digital-health-strengthening-standards-capability/infrastructure/containers/hapi-fhir-jpa-server/.dockerignore 
INFO[0000] Retrieving image manifest gcr.io/distroless/java17-debian12:nonroot 
INFO[0000] Retrieving image gcr.io/distroless/java17-debian12:nonroot from registry gcr.io 
error building image: unable to complete operation after 0 attempts, last error: GET https://gcr.io/v2/token?scope=repository%3Adistroless%2Fjava17-debian12%3Apull&service=gcr.io: UNAUTHORIZED: authentication failed

Triage Notes for the Maintainers

Description Yes/No
Please check if this a new feature you are proposing
Please check if the build works in docker but not in kaniko
Please check if this error is seen when you use --cache flag
Please check if your dockerfile is a multistage dockerfile
  • - []
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant