Skip to content

cant able to authenticate kaniko with GAR (google artifact repository) #3426

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

Open
manku211 opened this issue Mar 20, 2025 · 0 comments
Open

Comments

@manku211
Copy link

build-push:
stage: build-push
image: gcr.io/kaniko-project/executor:debug
script:
- echo "Preparing Kaniko configuration..."
- mkdir -p /kaniko/.docker
- echo "{"auths":{"${GAR_HOSTNAME}":{"auth":"$(echo -n _json_key:$(echo "$SERVICE_ACCOUNT_KEY" | base64 -w 0) | base64 -w 0)"}}}" > /kaniko/.docker/config.json
- echo "Building and pushing Docker image with Kaniko..."
- /kaniko/executor
--context "${CI_PROJECT_DIR}"
--dockerfile "${CI_PROJECT_DIR}/Dockerfile"
--destination "${GAR_HOSTNAME}/${PROJECT_ID}/${REPOSITORY}/${IMAGE_NAME}:${IMAGE_TAG}"
--destination "${GAR_HOSTNAME}/${PROJECT_ID}/${REPOSITORY}/${IMAGE_NAME}:latest"
only:
- dev

error checking push permissions -- make sure you entered the correct tag name, and that you are authenticated correctly, and try again: checking push permission for "us-central1-docker.pkg.dev/PROJECT_ID/ruh-ai/livekit-worker-service:dev-bfce870e": creating push check transport for us-central1-docker.pkg.dev failed: GET https://us-central1-docker.pkg.dev/v2/token?scope=repository%3PROJECT_ID%2Fruh-ai%2Flivekit-worker-service%3Apush%2Cpull&service=: UNAUTHORIZED: authentication failed

manually with gcloud it is working fine and I have check my service account permission, it is correct

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