GoogleContainerTools / kaniko

Build Container Images In Kubernetes
Apache License 2.0
14.67k stars 1.42k forks source link

.containterignore #1734

Open pierreyves-lebrun opened 3 years ago

pierreyves-lebrun commented 3 years ago

Actual behavior Kaniko currently expects .dockerignore file for excluding files/folders from image builds.

Expected behavior As the industry is moving away from Docker, it would be nice to support .containerignore as an alternate filename.

Additional Information Would you accept a PR that moves the currently hard coded .dockerignore value to a command line argument?

Description Yes/No
Please check if this a new feature you are proposing
  • - [x]
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
  • - [ ]
ebousse commented 1 year ago

For reference, this is already supported by Podman, and indeed would be great to see in kaniko :)

bncmajor commented 4 weeks ago

podman supports both, and if both are present it uses the .containerignore only. is this the behavior what would be the end goal here too?

I'd be happy to take this task on as my first issue

pierreyves-lebrun commented 4 weeks ago

podman supports both, and if both are present it uses the .containerignore only. is this the behavior what would be the end goal here too?

I'd be happy to take this task on as my first issue

Yes I think mimicking podman behavior would be great