flyte icon indicating copy to clipboard operation
flyte copied to clipboard

Editing .dockerignore does not invalidate image build cache

Open pingsutw opened this issue 8 months ago • 1 comments

Summary

When editing a .dockerignore file for a task environment, the image build cache is not invalidated and the environment image is not rebuilt. The only workaround is to modify the .toml file to force a rebuild.

Expected Behavior

Changes to .dockerignore should invalidate the image build cache and trigger a rebuild of the task environment image, since .dockerignore affects which files are included in the Docker build context and can change the resulting image.

Actual Behavior

Editing .dockerignore has no effect on cache invalidation. The previously cached image continues to be used until the .toml configuration file is modified.

Reproduction Steps

  1. Have a task environment with a working image build
  2. Edit the .dockerignore file (e.g., add or remove an entry)
  3. Trigger a build — observe that the cached image is reused without rebuilding
  4. Modify the .toml file (e.g., add a comment) — observe that the image is now rebuilt

Impact

This can lead to stale images being used that include or exclude files incorrectly based on outdated .dockerignore rules.

pingsutw avatar Mar 08 '26 04:03 pingsutw

https://github.com/flyteorg/flyte-sdk/pull/799

AdilFayyaz avatar Mar 16 '26 21:03 AdilFayyaz