Skip to content

Do not make hidden directory inside builder shim - #71

Merged
JaewonHur merged 4 commits into
apple:mainfrom
JaewonHur:fix-docker-ignore-2
Mar 14, 2026
Merged

Do not make hidden directory inside builder shim#71
JaewonHur merged 4 commits into
apple:mainfrom
JaewonHur:fix-docker-ignore-2

Conversation

@JaewonHur

@JaewonHur JaewonHur commented Mar 13, 2026

Copy link
Copy Markdown
Contributor

Previous docker ignore fix (#68) has race bug when syncing files to the buildkit daemon. Upon file request from buildkitd, the FSSync proxy in builder shim checks _checksum variable to check if build context is synced inside VM, and responds differently: i) if not, it forwards a request to the proxy outside to get the file, ii) if synced, it immediately provides the file.

However, since #68 creates a hidden docker directory inside builder shim during sync, if the request for Dockerfile is received before the sync, it just forwards the request outside, which doesn't know that hidden directory.

This PR assumes the directory is created outside, so that such request can be handled.

@JaewonHur
JaewonHur requested a review from jglogan March 14, 2026 04:01
@JaewonHur
JaewonHur merged commit ef922da into apple:main Mar 14, 2026
2 checks passed
JaewonHur added a commit that referenced this pull request Apr 18, 2026
This PR resolves the issue when using docker specific ignore file with read-only build context (apple/container#1343).

Once the `dockerignore` argument is provided in `PerformBuild` gRPC, it performs following two operations.

First, after unpacking transferred build context archive into `cache` directory, it creates a `DockerfileStaging` (i.e., `.com.apple.container`) directory there, and copies `Dockerfile` and `Dockerfile.dockerignore`. The path to `DockerfileStaging` is passed to the buildkit daemon so that it can correctly figure out which dockerignore file to read.

Second, it handles data requests for `Dockerfile` and `Dockerfile.dockerignore` (i.e., `diffcopy.go:sender::sendFile`), so that the requests before the actual files are written can be correctly served---i.e., refer #71 for more context about this race issue.
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.

2 participants