kaniko icon indicating copy to clipboard operation
kaniko copied to clipboard

Build Multiple Dockerfile from same build context

Open bkrajendra opened this issue 1 year ago • 2 comments

I have docker context with multiple Dockerfile in the directory. I have created a configmap of directory containing dockerfiles and mounted it to the /workspace folder in kaniko:

Dockerfile-base-service
Dockerfile-ui-service
Dockerfile-data-service

I am using Kubernetes job to run the kaniko container .

Is it possible to build all of the Dockerfile in single kaniko job/instance?

bkrajendra avatar Jun 20 '24 16:06 bkrajendra

Using --cleanup flag works for me, but is not the prefered option.

ahollmann avatar Jul 10 '24 15:07 ahollmann

+1, as @ahollmann mentioned currently the best method to have kaniko do this from a single kaniko job instance would be to use the --cleanup flag with each run which will reset the kaniko job to a clean state where it can build the next image.

aaron-prindle avatar Jul 16 '24 22:07 aaron-prindle