I am using the code outlined at the kaniko guided exploration (Guided Explorations / Containers / Simple Best Practice Container Build Using Kaniko with Layer Caching · GitLab)
The guided exploration works perfectly, apart from one thing, the built container ends up at :
I have tried adding:
–destination ${CI_REGISTRY_IMAGE}_updated
(so the line reads: /kaniko/executor --context $CI_PROJECT_DIR --dockerfile $CI_PROJECT_DIR/Dockerfile --destination ${CI_REGISTRY_IMAGE}_updated $KANIKO_CACHE_ARGS $FORMATTEDTAGLIST $IMAGE_LABELS)
But the build then fails with:
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 “foobar.example.com:5050/devops/debian_updated”: POST https://foobar.example.com:5050/v2/devops/debian_updated/blobs/uploads/: UNAUTHORIZED: authentication required; [map[Action:pull Class: Name:devops/debian_updated Type:repository] map[Action:push Class: Name:devops/debian_updated Type:repository]]
The problem is we know permissions is not the problem because if I remove the “–destination” flag that I added, the job runs and pushes again ok.