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

Warmer does not work with private images #503

Closed
jamesatha opened this issue Jan 3, 2019 · 8 comments · Fixed by #941
Closed

Warmer does not work with private images #503

jamesatha opened this issue Jan 3, 2019 · 8 comments · Fixed by #941
Labels
area/caching For all bugs related to cache issues kind/bug Something isn't working priority/p2 High impact feature/bug. Will get a lot of users happy

Comments

@jamesatha
Copy link

Actual behavior
I have a pod running the cache warmer. It has multiple --image arguments. The public images download just fine but the rest silently fail. I have made sure the docker config is mounted at /kaniko/.docker/config.json and the DOCKER_CONFIG environment variable is set to /kaniko/.docker/

Expected behavior
Should use the credentials specified to download the private image.

To Reproduce
Steps to reproduce the behavior:

  1. Create a pod with for the cache warmer. Make sure there are some private images. In the list of images. Make sure that the docker config is properly mounted.
  2. See that the private image was not downloaded

Additional Information
Using gcr.io/kaniko-project/warmer:latest

@mamoit
Copy link

mamoit commented Feb 12, 2019

I'm using gitlab ci and in order to configure docker it actually requires a shell.
Having a debug image for the warmer (as we have for kaniko itself) would give a lot of flexibility for this kind of use cases where some pre-configuring is needed.

@mamoit
Copy link

mamoit commented Feb 13, 2019

#497 should allow to setup the credentials prior to warming up the cache.

@mamoit
Copy link

mamoit commented Feb 15, 2019

I have built a debug kaniko image with the warmer inside of it, and I can verify what @jamesatha said, I try to pull the images with the docker config setup (that works with kaniko), but it silently fails when trying to pull a image from a private repo.

@pdemagny
Copy link

I also confirm that even when using #497, it still does not work with gitlab ci private registry :(
It would be awesome if it did !

@priyawadhwa priyawadhwa added the area/caching For all bugs related to cache issues label Jul 25, 2019
@efenex
Copy link

efenex commented Aug 13, 2019

same issue here, using debug image in combination with gitlab and warmer fails to pull private images, even though GOOGLE_APPLICATION_CREDENTIALS environment variable is configured and exported:

$ /kaniko/warmer --cache-dir=/cache --image=$CI_REGISTRY/private/base:1.4.3.1 --image=node:8-alpine
Failed warming cache: Failed to retrieve image: gitlab:4567/private/base:1.4.3.1: DENIED: access forbidden

@Enelar
Copy link

Enelar commented Sep 11, 2019

Confirmed. My workaround:

echo "FROM $SOURCE" > Dockerfile.try-pull
export IMAGE_NOT_EXISTS=$(executor --dockerfile Dockerfile.try-pull --no-push -v panic )
if [[ $IMAGE_NOT_EXISTS ]]
then
  # ...
fi

@Enelar
Copy link

Enelar commented Sep 11, 2019

@priyawadhwa please tag as issue/bug. This isn't documented behavior.
Lost several hours debugging build scripts because it wasn't mentioned that warmer is not using docker login configs.

Our build pipeline have several layers of caching partial images, because building from scratch taking tens of minutes. After migrating from dind to kaniko, for some modules build process broke out.

@priyawadhwa priyawadhwa added the kind/bug Something isn't working label Sep 12, 2019
@priyawadhwa
Copy link
Collaborator

Hey @Enelar I've tagged the issue. It looks like this is happening because we try to pull the image without credentials. We should be checking for credentials, as we do in the executor here.

If anyone is interested in submitting a PR, feel free to cc me and I can take a look at it.

@tejal29 tejal29 added the priority/p2 High impact feature/bug. Will get a lot of users happy label Sep 27, 2019
drappier-charles pushed a commit to drappier-charles/kaniko that referenced this issue Dec 10, 2019
Relate to GoogleContainerTools#503
The warmer should call for credential for pull the image from any registry.
drappier-charles pushed a commit to drappier-charles/kaniko that referenced this issue Dec 10, 2019
stijndehaes added a commit to stijndehaes/kaniko that referenced this issue Jan 1, 2020
stijndehaes added a commit to stijndehaes/kaniko that referenced this issue Jan 1, 2020
stijndehaes added a commit to stijndehaes/kaniko that referenced this issue Jan 15, 2020
stijndehaes added a commit to stijndehaes/kaniko that referenced this issue Jan 15, 2020
@cvgw cvgw closed this as completed in #941 Jan 17, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/caching For all bugs related to cache issues kind/bug Something isn't working priority/p2 High impact feature/bug. Will get a lot of users happy
Projects
None yet
Development

Successfully merging a pull request may close this issue.

7 participants