Use a subdirectory in git repo as docker context #1064
Labels
area/context
kind/enhancement
New feature or request
priority/p2
High impact feature/bug. Will get a lot of users happy
I have a use case where I want to build from a git repo with Kaniko. However, I have some git repos that have several projects in subdirectories with a Dockerfile and the application code in each subdirectory. I can't find a way with Kaniko to set the docker context to anything other than the root of the repo.
My current work-around is to copy the Dockerfiles in each subdirectory to the root directory, rename them, and edit them to reference the files in the subdirectory for each application.
Here is the script with the work-around https://github.com/rkamradt/batchjobs/blob/master/buildimage.yaml
The preferred parameter usage would be --dockerfile=hellokworld/Dockerfile and to have the docker context inferred from the directory the Dockerfile is in, or a seperate parameter to point into the context established by the git URL.
The text was updated successfully, but these errors were encountered: