#3281·kaniko

--kaniko-dir is not used for the context, only for the Dockerfile

Author: rabejensCreated Aug 7, 2024Updated May 29, 2025

Actual behavior When I am building an image with the Kaniko executor and specify --kaniko-dir, this only applies to the Dockerfile, not to the context

Expected behavior The Kaniko-Dir should be used for everything

To Reproduce Steps to reproduce the behavior:

Run this:

executor --kaniko-dir /somewhere --dockerfile /somewhere-else/Dockerfile --context /somewhere-else --no-push --tar-path container.tar

Additional Information

  • Dockerfile Happens with any Dockerfile
  • Build Context Happens with any build context
  • Kaniko Image (fully qualified with digest) No image, using kaniko from nixpkgs when building a derivation

Triage Notes for the Maintainers

Description Yes/No
Please check if this a new feature you are proposing
  • - [ ]
Please check if the build works in docker but not in kaniko
  • - [ ]
Please check if this error is seen when you use --cache flag
  • - [ ]
Please check if your dockerfile is a multistage dockerfile
  • - [ ]

Source: GoogleContainerTools/kaniko