-
Notifications
You must be signed in to change notification settings - Fork 2.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
podman excessively reads content of every file in the context directory on Windows. #20965
Comments
I want to restate that |
It is actually copying the entire context directory into the VM to be able to build the container. It can not figure out what is needed and not needed in the context directory until the Containerfile is processed. I believe you can use .containerignore or .dockerignore to cut down on the amount of files copied. |
It would be much faster if you just moved all of the content required for the build into the test directory and then just ran the build from there. |
I suspected of such behavior as I saw intensive TCP communication. The spec https://docs.docker.com/build/building/context/#filesystem-contexts
omits description of this behavior, wording makes files and directories in the current working directory available to the builder is evasive - leaving the room for further optimization, like avoiding copying the data prematurely and only taking what is referenced in |
Anyway I faced the issue only because #18840 is not yet fixed. As a workaround I'll make a Does it make sense to update the docs? It looks like copying of context dir to a VM is WSL 2 specific operation... Will I face this enormous delay issue on Linux? |
and in
Docker documentation also mentions that every file from build context is copied to the Docker server... |
Issue Description
When I run
podman build
on Windows 10 from the directory, containing other projects podman recursively reads all the subdirectories, with a big hierarchy is leads to minutes in delay.I see recursive behavior in procmon.exe, for every file it performs (and similar to every directory):
Steps to reproduce the issue
Run
podman build -f some/Containerfile .
from a directory with lots of files & directories (node_modules
are good candidate xD).Describe the results you received
Slow
podman build
execution.Describe the results you expected
I expect
podman build
to be nearly instantaneous.podman info output
Podman in a container
No
Privileged Or Rootless
None
Upstream Latest Release
Yes
Additional environment details
Win 10 + WSL 2.
Additional information
I'm facing the #18840 so to include external to the build directory files I moved context up and unrelated directories are scanned by podman...
My final step is
STEP 6/6: COPY test .
- so podman shouldn't read any non "test" files.The text was updated successfully, but these errors were encountered: