Repository navigation
Description
Is your feature request related to a problem? Please describe.
wslc build currently requires its positional build context to be a directory. It does not support using - to read a tar build context from standard input:
tar -czf context.tar.gz -C context .
wslc build --tag stdin-context:test - < context.tar.gzCurrently, - is interpreted as a host filesystem path and rejected because it is not a directory.
This prevents tools and pipelines from generating or filtering a build context as a tar stream and passing it directly to WSLC. Callers must instead materialize the context as a temporary directory, adding disk I/O, cleanup, and failure-handling requirements.
This is distinct from --file -, which reads only the Dockerfile from stdin while the build context still comes from a directory.
Describe the solution you'd like
Allow - as the positional build context:
wslc build [OPTIONS] -When stdin contains a tar archive, use the archive contents as the filesystem build context. The default Dockerfile and .dockerignore should be resolved from the archive root, and --file <path> should resolve the specified Dockerfile relative to that root.
At minimum, uncompressed tar archives should be supported. Ideally, this would match Docker's support for identity, gzip, bzip2, and xz-compressed tar streams.
Invalid archives or an interactive stdin should produce an actionable error. If both the context and --file are -, the command should also report clearly that both inputs cannot consume the same stream.
This would provide behavior equivalent to:
docker build - < context.tar.gz
docker build --file test.Dockerfile - < context.tar.gzDescribe alternatives you've considered
- Unpack the tar stream into a temporary directory and pass that directory to
wslc build. This works, but defeats streaming and requires additional disk space, cleanup, and error handling. - Use
--file -. This only supplies the Dockerfile through stdin and does not provide the files needed byCOPY,ADD, or other context-dependent operations.
Additional context
Docker documents tar build contexts supplied over stdin here:
Activity
github-actions commentedon Sep 16, 2026
Logs are required for review from WSL team
If this a feature request, please reply with '/feature'. If this is a question, reply with '/question'.
Otherwise, please attach logs by following the instructions below, your issue will not be reviewed unless they are added. These logs will help us understand what is going on in your machine.
How to collect WSL logs
Download and execute collect-wsl-logs.ps1 in an administrative powershell prompt:
The script will output the path of the log file once done.
If this is a networking issue, please use
.\collect-wsl-logs.ps1 -LogProfile networkinginstead, following the instructions in Collect WSL logs for networking issuesOnce completed please upload the output files to this GitHub issue.
See Collect WSL logs (recommended method).
If you choose to email these logs instead of attaching them to the bug, please send them to [email protected] with the GitHub issue number in the subject, and include a link to your GitHub issue comment in the message body, and reply with '/emailed-logs'.
karolz-ms commentedon Sep 16, 2026
/feature
github-actions commentedon Sep 16, 2026
Diagnostic information
dkbennett commentedon Sep 30, 2026
I thought we did support stdin input, assigning to Gavin to investigate and fix any bugs in this.
ggarzia-MSFT commentedon Oct 1, 2026
No, we do not currently support this. I will look into implementing this
ggarzia-MSFT commentedon Oct 7, 2026
Closed here: #41765