Skip to content

fix(publish): honor env_file required: false for missing files#13848

Open
Ijtihed wants to merge 1 commit into
docker:mainfrom
Ijtihed:fix/publish-optional-env-file
Open

fix(publish): honor env_file required: false for missing files#13848
Ijtihed wants to merge 1 commit into
docker:mainfrom
Ijtihed:fix/publish-optional-env-file

Conversation

@Ijtihed

@Ijtihed Ijtihed commented Jun 17, 2026

Copy link
Copy Markdown

What I did

When env_file declares required false and the file is missing then docker compose publish now skips the file instead of failing. If the optional file exists it is still scanned for sensitive data and included as a layer which preserves existing behavior.

Two locations needed guards:

  • processFile: where env files are hashed and added as OCI layers
  • checkForSensitiveData: where env files are scanned for secrets

Non-ENOENT errors (permissions, etc.) still propagate regardless of the required flag.

Related issue

Fixes #13648

Supersedes #13650, #13651, #13652 with a diff implementing what the maintainers request in #13652 review

image

(unrelated photo of my fiance's cute cat :3)

Signed-off-by: Ijtihed Kilani <ijtihedk@gmail.com>
@Ijtihed Ijtihed requested a review from a team as a code owner June 17, 2026 05:21
@Ijtihed Ijtihed requested review from glours and ndeloof June 17, 2026 05:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[BUG] docker compose publish ignores required: false on env_file

1 participant