allow to set DOCKER_CONFIG to a file #2894
Labels
gitlab
kind/feature-request
priority/p2
High impact feature/bug. Will get a lot of users happy
work-around-available
We are using GitLab CI pipelines and would like to set
DOCKER_CONFIG
to a file instead of a directory so that we can use CI variables of typefile
. The current working approach in GitLab looks similar to this (see official docs):The above examples requires 3 variables (REGISTRY, USER, PASSWORD) to write a file into the kaniko container. We can use file variables to reduce this to:
In this example, DOCKER_CONFIG_JSON is the file variable which contains the entire JSON document. GitLab will automatically add that file to the container and populate the
DOCKER_CONFIG_JSON
value with the path to the created file.I have noticed that there is https://github.com/GoogleContainerTools/kaniko/blob/main/pkg/util/gcr_util.go which does the right thing(tm) but does not appear to be used anywhere. The various other places where
DOCKER_CONFIG
is read all assume that it is a directory.Triage Notes for the Maintainers
--cache
flagThe text was updated successfully, but these errors were encountered: