Skip to content

Fix: respect required: false for env_file in publish command#13650

Closed
maks2134 wants to merge 5 commits intodocker:mainfrom
maks2134:fix/env-file-required-false-in-publish
Closed

Fix: respect required: false for env_file in publish command#13650
maks2134 wants to merge 5 commits intodocker:mainfrom
maks2134:fix/env-file-required-false-in-publish

Conversation

@maks2134
Copy link

What I did
Fixed the docker compose publish command to properly handle env_file entries with required: false. The command was previously ignoring this setting and failing when optional env files were missing.

Changes made:

  • Modified checkForSensitiveData() to skip scanning env files with required: false
  • Updated processFile() to only process required env files into publish layers
  • Fixed checkEnvironmentVariables() to only consider required env files for environment warnings
  • Added comprehensive tests to verify the fix works correctly

Related issue
fixes #13648

(not mandatory) A picture of a cute animal, if possible in relation to what you did

maks2134 added 5 commits March 17, 2026 00:16
Resolves race condition between main thread calling Done() and UI thread
calling printWithDimensions(). The issue was that Done() held the mutex
while sending to the done channel, but the UI thread needed the same
mutex to process the done signal.

Fixed by sending the done signal before acquiring the mutex, allowing
the UI thread to receive the signal and release any held locks.

Fixes docker#13639
# Conflicts:
#	cmd/display/tty_test.go
- Change format flag default from "table" to empty string to allow config override
- Add logic to use PsFormat from config when no format argument provided
- Fall back to "table" format when neither PsFormat nor format arg is set
- Add warning when both --format and --quiet flags are used
- Add test to verify format flag default value

Fixes docker#13643

Signed-off-by: maks2134 <maks210306@yandex.by>
Fixes docker#13648

The docker compose publish command was ignoring required: false
setting on env_file entries, causing failures when optional env files
were missing.

Changes made:
- Modified checkForSensitiveData() to skip env files with required: false
- Updated processFile() to only process required env files into layers
- Fixed checkEnvironmentVariables() to only consider required env files
- Added comprehensive tests to verify the fix

Signed-off-by: Maks Kozlov <maks@example.com>
Signed-off-by: maks2134 <maks210306@yandex.by>
@maks2134 maks2134 force-pushed the fix/env-file-required-false-in-publish branch from ca55904 to 5b111bb Compare March 20, 2026 20:48
@maks2134 maks2134 requested a review from a team as a code owner March 20, 2026 20:48
@maks2134 maks2134 requested review from glours and ndeloof March 20, 2026 20:48
@maks2134 maks2134 closed this Mar 20, 2026
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