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
cannot docker stop
(SIGINT?) a tail -f /dev/null command
#4953
Comments
@ORESoftware Thanks for reporting the issue here but I think you are somewhat mistaken by the syntax you have used for running the What you intended to run: tail -f /dev/null What you effectively ran: tail What?? Yes. As you haven't "quoted" the command you want to run as the entrypoint, the docker run -d --name foo --entrypoint "tail -f /dev/null" xyz Note: There's no such flag as As for why you are stuck and not able to |
No, I think the syntax used is correct; the example uses docker run -d --name foo --entrypoint tail <image name> -f /dev/null In the above, the entrypoint is docker run -d --name foo --entrypoint tail alpine -f /dev/null
docker inspect --format '{{ json .Config.Entrypoint }}' foo
["tail"]
docker inspect --format '{{ json .Config.Cmd }}' foo
["-f","/dev/null"] However, I'm not able to reproduce the problem reported; the container is ultimately stopped, but it takes ~10 seconds before it completes; time docker stop foo
foo
real 0m10.164s
user 0m0.006s
sys 0m0.008s
docker ps -a
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
e2133f3661bf alpine "tail -f /dev/null" About a minute ago Exited (137) 5 seconds ago foo So, why does it take 10 seconds? In this example, More information can be found in the There are some options though;
Repeating the earlier example, but now with docker run -d --name foo --init --entrypoint tail alpine -f /dev/null
time docker stop foo
foo
real 0m0.127s
user 0m0.006s
sys 0m0.006s
docker ps -a
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
17b5f5cd080d alpine "tail -f /dev/null" 27 seconds ago Exited (143) 15 seconds ago foo |
Based on the above, I don't think there's a bug at hand here, so I'll close this ticket, but feel free to continue the conversation. |
Description
I we do this:
effectively we are running
but I cannot run:
I have to docker kill foo, to get it to exit.
Likewise, I cannot SIGINT it, using ctrl-C
which is always a bad user experience.
I feel like it should be able to trap SIGINT's always. But it might be impossible to always to have the desired shell experience.
Reproduce
same as above
Expected behavior
should always be able to stop a container
docker version
docker info
Additional Info
No response
The text was updated successfully, but these errors were encountered: