Skip to content

fix(watch): exclude Dockerfile and compose files from initial sync - #14117

Open
htoyoda18 wants to merge 1 commit into
docker:mainfrom
htoyoda18:fix/watch-initial-sync-exclude-compose-files
Open

fix(watch): exclude Dockerfile and compose files from initial sync#14117
htoyoda18 wants to merge 1 commit into
docker:mainfrom
htoyoda18:fix/watch-initial-sync-exclude-compose-files

Conversation

@htoyoda18

Copy link
Copy Markdown
Contributor

What I did

initialSync's doc comment promises that the Dockerfile and compose files are never copied into the container during docker compose watch's initial sync — but the matcher enforcing that was dropped without replacement in a January 2025 refactor (#12469), leaving only a // FIXME .dockerignore comment where it used to sit. Neither .dockerignore-derived ignores nor EphemeralPathMatcher() (editor swap/temp files) cover this, so a develop.watch trigger whose path includes the project root would copy Dockerfile/compose.yaml into the running container on initial sync.

Reintroduced a dedicated dockerFileIgnore matcher (Dockerfile, *compose*.y*ml) inside initialSync, matching the pre-refactor behavior.

Scoped to initialSync only: the continuous watch loop's ignore (getWatchRules) never carried this exclusion, and — because it matches against full paths rather than basenames — would need a differently-anchored matcher to work there; that's a separate change if wanted.

Related issue
N/A

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

Signed-off-by: hiroto.toyoda <hiroto.toyoda@dena.com>
@htoyoda18
htoyoda18 requested review from a team as code owners August 23, 2026 13:49
@htoyoda18
htoyoda18 requested review from glours and ndeloof August 23, 2026 13:49
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.

1 participant