Skip to content
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

Piping content to a container fails #3298

Closed
R-Beck-2020 opened this issue Oct 28, 2022 · 5 comments
Closed

Piping content to a container fails #3298

R-Beck-2020 opened this issue Oct 28, 2022 · 5 comments
Labels
kind/bug Something isn't working platform/windows runtime/moby triage/duplicate This issue or pull request already exists

Comments

@R-Beck-2020
Copy link

R-Beck-2020 commented Oct 28, 2022

Actual Behavior

I have been investigating replacing Docker Desktop with Rancher Desktop, I ran across some weird behaviour when piping content in to docker run:

Get-Content .\Dockerfile | docker run --rm -i hadolint/hadolint

Side note: This is a very basic use case and as per the guide: https://github.com/hadolint/hadolint

  • Confirmed working in Docker Desktop

Actual behaviour: The command prompt (pwsh) hangs until the docker container is stopped from another terminal.

There are insufficient logs to pinpoint the issue, however the repro steps are very simple.

Steps to Reproduce

Installed:
Rancher Desktop 1.6.1, using dockerd (Moby) / run the following command in PowerShell, piping in any file.
Get-Content .\Dockerfile | docker run --rm -i hadolint/hadolint

Result

The task hangs / does not complete. Logs for the hadolint container are empty and it appears nothing happens.

Expected Behavior

The task should complete with console output to the PowerShell window and a suitable exit code returned.

When run with a README.md file, and using Docker Desktop, the reponse was:
image

Additional Information

No response

Rancher Desktop Version

1.6.1

Rancher Desktop K8s Version

N/A

Which container engine are you using?

moby (docker cli)

What operating system are you using?

Windows

Operating System / Build Version

Windows 10, 21H2

What CPU architecture are you using?

x64

Linux only: what package format did you use to install Rancher Desktop?

No response

Windows User Only

N/A

@R-Beck-2020 R-Beck-2020 added the kind/bug Something isn't working label Oct 28, 2022
@adamkpickering
Copy link
Member

Thanks for writing this issue up. I was able to reproduce this on Windows 10 using version 1.6.1.

When I tried a similar thing on Linux (using the command cat Dockerfile | docker run --rm -i hadolint/hadolint) it worked fine.

You say that there was nothing in the logs for the hadolint container, but I couldn't see any hadolint container at all:

PS C:\Users\adamk> docker container ls -a
CONTAINER ID   IMAGE                  COMMAND                  CREATED              STATUS                          PORTS     NAMES
d1ebe708b755   hello-world            "/hello"                 About a minute ago   Exited (0) About a minute ago             elastic_albattani
702095c1ee97   dbd43b6716a0           "entry"                  2 minutes ago        Up 2 minutes                              k8s_lb-tcp-443_svclb-traefik-56f1a547-494q6_kube-system_99f69b33-8873-4e5f-b463-14d615f9582f_4
6653d0dade98   dbd43b6716a0           "entry"                  2 minutes ago        Up 2 minutes                              k8s_lb-tcp-80_svclb-traefik-56f1a547-494q6_kube-system_99f69b33-8873-4e5f-b463-14d615f9582f_4
d2ba4f0e5629   fb9b574e03c3           "local-path-provisio…"   2 minutes ago        Up 2 minutes                              k8s_local-path-provisioner_local-path-provisioner-5b5579c644-5hqnl_kube-system_021023d4-75f0-46d5-ae26-e8a3bcd59ef9_6
842b51a30245   99376d8f35e0           "/coredns -conf /etc…"   2 minutes ago        Up 2 minutes                              k8s_coredns_coredns-75fc8f8fff-h2pmm_kube-system_7199750e-f0b3-47b0-b67f-0261a922b097_4
1751a4771ec3   72463d8000a3           "/entrypoint.sh --gl…"   2 minutes ago        Up 2 minutes                              k8s_traefik_traefik-7d647b7597-zhhct_kube-system_d9adbcf0-1eda-462d-a9d0-ff32611df62c_4
57c966e4a1d3   k8s.gcr.io/pause:3.6   "/pause"                 2 minutes ago        Up 2 minutes                              k8s_POD_local-path-provisioner-5b5579c644-5hqnl_kube-system_021023d4-75f0-46d5-ae26-e8a3bcd59ef9_0
0b2f6cdc20fe   f73640fb5061           "/metrics-server --c…"   2 minutes ago        Up 2 minutes                              k8s_metrics-server_metrics-server-74474969b-zl9gk_kube-system_806dc0b8-65fd-461d-9c58-1eee2788f63e_7
fa50d83d738c   k8s.gcr.io/pause:3.6   "/pause"                 2 minutes ago        Up 2 minutes                              k8s_POD_traefik-7d647b7597-zhhct_kube-system_d9adbcf0-1eda-462d-a9d0-ff32611df62c_0
7689d1919d62   k8s.gcr.io/pause:3.6   "/pause"                 2 minutes ago        Up 2 minutes                              k8s_POD_coredns-75fc8f8fff-h2pmm_kube-system_7199750e-f0b3-47b0-b67f-0261a922b097_0
3c91fe927dbe   k8s.gcr.io/pause:3.6   "/pause"                 2 minutes ago        Up 2 minutes                              k8s_POD_metrics-server-74474969b-zl9gk_kube-system_806dc0b8-65fd-461d-9c58-1eee2788f63e_0
1b31be9507cb   k8s.gcr.io/pause:3.6   "/pause"                 2 minutes ago        Up 2 minutes                              k8s_POD_svclb-traefik-56f1a547-494q6_kube-system_99f69b33-8873-4e5f-b463-14d615f9582f_0
PS C:\Users\adamk> docker image ls
REPOSITORY                         TAG                    IMAGE ID       CREATED         SIZE
rancher/mirrored-library-busybox   1.34.1                 2bd29714875d   6 weeks ago     1.24MB
rancher/klipper-helm               v0.7.3-build20220613   38b3b9ad736a   4 months ago    239MB
hadolint/hadolint                  latest                 489e464fa6c4   7 months ago    2.3MB
rancher/mirrored-library-traefik   2.6.2                  72463d8000a3   7 months ago    102MB
rancher/mirrored-coredns-coredns   1.9.1                  99376d8f35e0   7 months ago    49.5MB
rancher/klipper-lb                 v0.3.5                 dbd43b6716a0   9 months ago    8.09MB
rancher/local-path-provisioner     v0.0.21                fb9b574e03c3   10 months ago   35MB
rancher/mirrored-metrics-server    v0.5.2                 f73640fb5061   11 months ago   64.3MB
hello-world                        latest                 feb5d9fea6a5   13 months ago   13.3kB
rancher/mirrored-pause             3.6                    6270bb605e12   14 months ago   683kB
k8s.gcr.io/pause                   3.6                    6270bb605e12   14 months ago   683kB

I see the following in docker.log:

time="2022-10-28T20:47:34.364940400Z" level=info msg="loading plugin \"io.containerd.event.v1.publisher\"..." runtime=io.containerd.runc.v2 type=io.containerd.event.v1
time="2022-10-28T20:47:34.364985100Z" level=info msg="loading plugin \"io.containerd.internal.v1.shutdown\"..." runtime=io.containerd.runc.v2 type=io.containerd.internal.v1
time="2022-10-28T20:47:34.365001800Z" level=info msg="loading plugin \"io.containerd.ttrpc.v1.task\"..." runtime=io.containerd.runc.v2 type=io.containerd.ttrpc.v1
time="2022-10-28T20:47:34.365160700Z" level=info msg="starting signal loop" namespace=moby path=/run/docker/containerd/daemon/io.containerd.runtime.v2.task/moby/4c03becc37ad2f89efbb5c0b9d321a111545794b77c0fcd04c698853103cf328 pid=8350 runtime=io.containerd.runc.v2
time="2022-10-28T20:47:38.822815300Z" level=info msg="shim disconnected" id=4c03becc37ad2f89efbb5c0b9d321a111545794b77c0fcd04c698853103cf328
time="2022-10-28T20:47:38.822940000Z" level=info msg="ignoring event" container=4c03becc37ad2f89efbb5c0b9d321a111545794b77c0fcd04c698853103cf328 module=libcontainerd namespace=moby topic=/tasks/delete type="*events.TaskDelete"
time="2022-10-28T20:47:38.823110100Z" level=warning msg="cleaning up after shim disconnected" id=4c03becc37ad2f89efbb5c0b9d321a111545794b77c0fcd04c698853103cf328 namespace=moby
time="2022-10-28T20:47:38.823334200Z" level=info msg="cleaning up dead shim"
time="2022-10-28T20:47:38.827566300Z" level=warning msg="cleanup warnings time=\"2022-10-28T20:47:38Z\" level=info msg=\"starting signal loop\" namespace=moby pid=8560 runtime=io.containerd.runc.v2\n"
time="2022-10-28T20:47:38.828152000Z" level=error msg="attach failed with error: error attaching stdout stream: write unix /mnt/wsl/rancher-desktop/run/docker.sock->@: write: broken pipe"

This needs further investigation, but this might be pointing towards a problem with cri-dockerd? Not sure if it's related, but I see a bunch of messages like this in cri-dockerd.log:

time="2022-10-28T20:49:24Z" level=error msg="ContainerStats resp: {0xc000a54880 linux}"

@jandubois
Copy link
Member

Looks like a duplicate of #2094

@R-Beck-2020
Copy link
Author

Thanks for the replies.

@adamkpickering
Whilst the command was hanging, I could find the container running with docker ps -a in a new terminal.

@jandubois
It does indeed seem similar to the issue that you linked. Hopefully it will get investigated in the near future 🤞

@adamkpickering
Copy link
Member

@jandubois shall we close this one then?

@jandubois
Copy link
Member

Yes, let's close as a duplicate of #2094.

@jandubois jandubois added the triage/duplicate This issue or pull request already exists label Nov 1, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug Something isn't working platform/windows runtime/moby triage/duplicate This issue or pull request already exists
Projects
None yet
Development

No branches or pull requests

3 participants