A way to kill the container by signaling `docker run`
@laurazard is already working on this.
Since Oct 4, 2024.
- Dominant language
- Go
- Stars
- 6.1k
- Forks
- 2.2k
- Avg merge
- 1d 15h
- Merged PRs (30d)
- 43
Description
Description
The docker run --sig-proxy can't forward SIGKILL because it can't actually receive it without dying itself. But this means there's no way to send SIGKILL to the contained process by signaling docker run, and thus, as far as I can tell, no way to achieve the effect of docker kill and reliably destroy the attached container by signaling docker run.
I would like to be able to configure docker run to tear down the attached container upon receiving some signal (maybe SIGTERM or SIGHUP), regardless of whether it was started with --init or what the PID 1 process inside chooses to do in response to signals.
Workarounds for not having this feature:
- Use
--init(and hope you didn't need your container's own init process or handling of any signals that Docker's init uses, and that Docker's init doesn't hang or get agdbattached to it or otherwise malfunction). - Use a shell script that wraps
docker run, traps a signal, and issues adocker kill.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.