-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
When --cache true
and --registry-mirror ...
kaniko cannot find manifest
#1172
Comments
|
@tejal29 I'll give it a look, cheers. |
@ajcollett I suspect that's because the mirror is using the strict validation name, which adds Do you mind trying this image which uses weak validation? If this doesn't work, the cache will have to use strict validation as well. |
This does not resolve the issue for me:
The first line of the Dockerfile is |
@zaventh okay, I'll try to setup the cache for ourselves. The alternative I've had in mind what that the cache should use the StrictValidation. |
Hello @zaventh, Just want to clarify what you mean by below?
I setup the docker "pull-through cache" myself. I can post the docker file if that'd be helpful, but it's very standard. Normally we set the "registry-mirrors" settings up in the daemon on our servers, and the image names just work. No Pretty much use this: https://docs.docker.com/registry/recipes/mirror/ |
does it work when |
Another question, do you mind pointing me where the https://github.com/GoogleContainerTools/kaniko#caching-base-images |
okay, I can reproduce it. $ docker run --rm -v $(pwd)/test:/workspace -v $(pwd)/cache:/cache greut/executor:debug-v0.22.0 -f Dockerfile.3 --registry-mirror [REDACTED] --no-push
INFO[0000] Retrieving image manifest ubuntu:bionic
ERRO[0003] Error while retrieving image from cache: ubuntu:bionic GET https://[REDACTED]/v2/ubuntu/manifests/bionic: MANIFEST_UNKNOWN: manifest unknown; map[Tag:bionic]
INFO[0003] Retrieving image manifest ubuntu:bionic
error building image: GET https://[REDACTED]/v2/ubuntu/manifests/bionic: MANIFEST_UNKNOWN: manifest unknown; map[Tag:bionic] |
@ajcollett |
@greut That fix does indeed work. I was able to build images where both the |
@greut It works for me now! I have tested both with and without Thanks for this! Some more info. I am using a GitLab instance, which has built in capability to cache layers. My .gitlab-ci.yml for interest sake (sorry, I didn't twig this might be helpful earlier): .build-kaniko-image:
stage: build
variables:
BUILD_DOCKERFILE: $CI_PROJECT_DIR/Dockerfile
IMAGE_TAG: $CI_COMMIT_TAG
REGISTRY_MIRROR: "our-internal-mirror"
CACHE: "true"
CLEANUP: "true"
image:
name: greut/executor:debug-v0.22.1-alpha.1
entrypoint: [""]
script:
- echo "{\"auths\":{\"$CI_REGISTRY\":{\"username\":\"$CI_REGISTRY_USER\",\"password\":\"$CI_REGISTRY_PASSWORD\"}}}" > /kaniko/.docker/config.json
- /kaniko/executor --registry-mirror ${REGISTRY_MIRROR} --context ${CI_PROJECT_DIR} --dockerfile ${BUILD_DOCKERFILE} --destination ${CI_REGISTRY_IMAGE}:${IMAGE_TAG} --cache=${CACHE} --cleanup=${CLEANUP}
tags:
- our-docker-image-builder |
Actual behavior
When running the docker kaniko debug image with
--cache true
and--registry-mirror ...
kaniko throws error about not being able to find the manifest of the base image.
This works if
library/
is added to the base image name in theFROM
line, in the Dockerfile. This shouldn't be required?Error output:
Expected behavior
Docker image should be built assuming
library/
for the base image, unless otherwise specified.To Reproduce
Steps to reproduce the behavior:
--cache true
and--registry-mirror ...
on a buildFROM
line does NOT specifylibrary/
in the image name.manifest unknown
.Additional Information
Failed gitlab pipeline:
https://git.cs.sun.ac.za/Computer-Science/docker-prebuild/sun-ubuntu/-/jobs/226756
Working pipeline after adding
library/...
to dockerfileFROM
line.https://git.cs.sun.ac.za/Computer-Science/docker-prebuild/sun-ubuntu/-/jobs/226767
Example repo with dockerfile and .gitlab-ci.yml:
https://git.cs.sun.ac.za/Computer-Science/docker-prebuild/sun-ubuntu
Triage Notes for the Maintainers
--cache
flagThe text was updated successfully, but these errors were encountered: