Docker on Windows using WSL daemon does not print exec output
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 4/5
- Tiempo estimado
- 3-5 días
- Aptitud para principiantes
- 35/100
- Tipo de issue
- Error
- Claridad
- Bastante claro
- Estado de actividad
- Estancado
- Stack tecnológico
- docker, go
- Área
- cli, operating-systems
Línea de trabajo
Comienza reproduciendo los comandos docker exec indicados en el cliente de Windows con un daemon de WSL, comparando stdin activo y ausente, y revisa las issues y PRs relacionados de Docker CLI. Rastrea el procesamiento de la salida de exec y de stdin desde el punto de entrada de la CLI; se considera terminado cuando los comandos de contenedores Linux muestran la salida de forma coherente en entornos interactivos y similares a CI, sin provocar regresiones en el comportamiento de los contenedores Windows.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
Description
Running docker exec against a container running on the WSL Docker daemon returns no output.
Adding -i fixes the problem when running in an interactive PowerShell session.
However, when running in an environment with no stdin (like an Azure DevOps pipeline), even -i does not fix the output.
Related issues/PRs:
- https://github.com/docker/cli/issues/3586
- https://github.com/docker/cli/pull/4548
- https://github.com/golang/go/issues/35892#issuecomment-2568283851
- https://go-review.googlesource.com/c/go/+/637939
Reproduce
Using Windows Server 2022 with Docker Engine (not Desktop) installed, but should reproduce on any modern Windows OS with a Docker client.
- Install Docker in WSL and expose a TCP port.
# In WSL Bash curl -fsSL https://get.docker.com -o get-docker.sh ./get-docker.sh mkdir -p /etc/systemd/system/docker.service.d cat <<EOF > /etc/systemd/system/docker.service.d/docker.conf [Service] ExecStart= ExecStart=/usr/bin/dockerd EOF cat <<EOF > /etc/docker/daemon.json { "hosts": ["unix:///var/run/docker.sock", "tcp://0.0.0.0:2375"], "tls": false } EOF systemctl daemon-reload systemctl restart docker - In the Windows Docker client (running via PowerShell), add a context for WSL using the TCP port.
# In PowerShell (all remaining steps as well) docker context create wsl --docker "host=tcp://localhost:2375" docker context use wsl - Create a Linux container in WSL Docker using the Windows Docker client.
docker -c wsl run --rm -d --name linux-container mcr.microsoft.com/azurelinux/base/core:3.0 tail -f /dev/null - Create a Windows container as well.
docker -c default run --rm -d --name windows-container mcr.microsoft.com/windows/nanoserver:ltsc2022 cmd /c ping -t localhost > NUL - Run a command in the Linux container (these will return no output).
docker -c wsl exec linux-container cat /etc/os-release $null | docker -c wsl exec linux-container cat /etc/os-release $null | docker -c wsl exec -i linux-container cat /etc/os-release - Run a command in the Linux container (this will return output).
docker -c wsl exec -i linux-container cat /etc/os-release - Run a command in the Windows container (these will return output).
docker -c default exec windows-container ping docker -c default exec -i windows-container ping $null | docker -c default exec windows-container ping $null | docker -c default exec -i windows-container ping
Expected behavior
The commands in step 5 which run in the Linux container should all return output, but they do not. Only the command in step 6 works, but it relies on having an active stdin (not the case in CI like Azure DevOps pipelines, replicated by the $null | ... commands).
docker version
$ docker -c wsl version
Client:
Version: 28.3.2
API version: 1.51
Go version: go1.24.5
Git commit: 578ccf6
Built: Wed Jul 9 16:12:31 2025
OS/Arch: windows/amd64
Context: wsl
Server: Docker Engine - Community
Engine:
Version: 28.3.2
API version: 1.51 (minimum version 1.24)
Go version: go1.24.5
Git commit: e77ff99
Built: Wed Jul 9 16:13:45 2025
OS/Arch: linux/amd64
Experimental: false
containerd:
Version: 1.7.27
GitCommit: 05044ec0a9a75232cad458027ca83437aae3f4da
runc:
Version: 1.2.5
GitCommit: v1.2.5-0-g59923ef
docker-init:
Version: 0.19.0
GitCommit: de40ad0
$ docker -c default version
Client:
Version: 28.3.2
API version: 1.51
Go version: go1.24.5
Git commit: 578ccf6
Built: Wed Jul 9 16:12:31 2025
OS/Arch: windows/amd64
Context: default
Server: Docker Engine - Community
Engine:
Version: 28.3.2
API version: 1.51 (minimum version 1.24)
Go version: go1.24.5
Git commit: e77ff99
Built: Wed Jul 9 15:41:13 2025
OS/Arch: windows/amd64
Experimental: false
docker info
$ docker -c wsl info
Client:
Version: 28.3.2
Context: wsl
Debug Mode: false
Server:
Containers: 2
Running: 2
Paused: 0
Stopped: 0
Images: 5
Server Version: 28.3.2
Storage Driver: overlay2
Backing Filesystem: extfs
Supports d_type: true
Using metacopy: false
Native Overlay Diff: true
userxattr: false
Logging Driver: json-file
Cgroup Driver: systemd
Cgroup Version: 2
Plugins:
Volume: local
Network: bridge host ipvlan macvlan null overlay
Log: awslogs fluentd gcplogs gelf journald json-file local splunk syslog
CDI spec directories:
/etc/cdi
/var/run/cdi
Swarm: inactive
Runtimes: io.containerd.runc.v2 runc
Default Runtime: runc
Init Binary: docker-init
containerd version: 05044ec0a9a75232cad458027ca83437aae3f4da
runc version: v1.2.5-0-g59923ef
init version: de40ad0
Security Options:
seccomp
Profile: builtin
cgroupns
Kernel Version: 6.6.87.2-microsoft-standard-WSL2
Operating System: Ubuntu 24.04.2 LTS
OSType: linux
Architecture: x86_64
CPUs: 16
Total Memory: 62.8GiB
Name: mark-test-vm2
ID: c8957280-19af-4e36-86d7-fac6425f4b5b
Docker Root Dir: /var/lib/docker
Debug Mode: false
Experimental: false
Insecure Registries:
::1/128
127.0.0.0/8
Live Restore Enabled: false
[DEPRECATION NOTICE]: API is accessible on http://0.0.0.0:2375 without encryption.
Access to the remote API is equivalent to root access on the host. Refer
to the 'Docker daemon attack surface' section in the documentation for
more information: https://docs.docker.com/go/attack-surface/
In future versions this will be a hard failure preventing the daemon from starting! Learn more at: https://docs.docker.com/go/api-security/
$ docker -c default info
Client:
Version: 28.3.2
Context: default
Debug Mode: false
Server:
Containers: 1
Running: 1
Paused: 0
Stopped: 0
Images: 3
Server Version: 28.3.2
Storage Driver: windowsfilter
Windows:
Logging Driver: json-file
Plugins:
Volume: local
Network: ics internal l2bridge l2tunnel nat null overlay private transparent
Log: awslogs etwlogs fluentd gcplogs gelf json-file local splunk syslog
CDI spec directories:
/etc/cdi
/var/run/cdi
Swarm: inactive
Default Isolation: process
Kernel Version: 10.0 20348 (20348.1.amd64fre.fe_release.210507-1500)
Operating System: Microsoft Windows Server Version 21H2 (OS Build 20348.3932)
OSType: windows
Architecture: x86_64
CPUs: 16
Total Memory: 128GiB
Name: mark-test-vm2
ID: 27828f3f-c78c-4bc9-b7f3-f2fbeee7f3ae
Docker Root Dir: C:\ProgramData\docker
Debug Mode: false
Experimental: false
Insecure Registries:
::1/128
127.0.0.0/8
Live Restore Enabled: false
Product License: Community Engine
Additional Info
Docker client is on Windows, Docker daemon is on WSL 2 (Ubuntu). Tested via Windows Sever 2022 running in Azure.
If you add the debug flag -D to the commands you can see some extra output which could help with troubleshooting:
$null | docker -D -c default exec -i windows-container ping
(...output...)
time="2025-07-29T18:40:58Z" level=debug msg="[hijack] End of stdin"
time="2025-07-29T18:40:58Z" level=debug msg="[hijack] End of stdout"
docker -D -c wsl exec -i linux-container cat /etc/os-release
(...output...)
time="2025-07-29T18:43:24Z" level=debug msg="[hijack] End of stdout"
$null | docker -D -c wsl exec -i linux-container cat /etc/os-release
time="2025-07-29T18:42:17Z" level=debug msg="[hijack] End of stdin"
time="2025-07-29T18:42:17Z" level=debug msg="[hijack] End of stdout"
- Lenguaje dominante
- Go
- Estrellas
- 6.1k
- Forks
- 2.2k
- Merge medio
- 1 d 10 h
- PR fusionados (30 d)
- 47
Guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de docker/cli
-
kind/bug status/0-triage
Dificultad 2/5 1-3 horas Aptitud para principiantes 75/100
-
kind/bug status/0-triage
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 74/100
-
kind/feature status/0-triage
Dificultad 2/5 1-3 horas Aptitud para principiantes 70/100
-
kind/bug status/0-triage
Dificultad 2/5 1-3 horas Aptitud para principiantes 76/100
Todos los issues de docker/cli
Issues similares
-
Dificultad 1/5 Menos de una hora Aptitud para principiantes 60/100
github/gh-aw-mcpg#13748 ·
-
agentic-workflows
Dificultad 2/5 1-3 horas Aptitud para principiantes 65/100
-
needs-triage
Dificultad 2/5 1-3 horas Aptitud para principiantes 75/100
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 65/100
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 75/100
googleapis/librarian#7670 · 2 comentarios ·