You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Running a container in the foreground via docker run and pressing ctrl-c sends exactly one signal (defined by STOPSIGNAL in the Dockerfile) to the running process.
Actual behavior
Two signals are sent to the running container, causing undesired behavior in the running application. Running with -it (interactive, TTY) produces a single signal, as expected.
Information
Is it reproducible? Yes
Is the problem new? Yes - this seems to have been a behavior change at Docker Desktop 2.4.0. Prior versions send a single signal as expected.
Did the problem appear with an update? Versions from 2.4.0 onward exhibit the unexpected multiple signals behavior.
macOS Version: 10.15.7
Steps to reproduce the behavior
Create a Dockerfile with the following content:
FROM ubuntu:20.04
COPY sig.sh /sig.sh
RUN chmod +x /sig.sh
STOPSIGNAL SIGINT
ENTRYPOINT ["/sig.sh"]
Create a script file sig.sh with the following content:
Expected behavior
Running a container in the foreground via
docker runand pressing ctrl-c sends exactly one signal (defined by STOPSIGNAL in the Dockerfile) to the running process.Actual behavior
Two signals are sent to the running container, causing undesired behavior in the running application. Running with
-it(interactive, TTY) produces a single signal, as expected.Information
Steps to reproduce the behavior
Dockerfilewith the following content:sig.shwith the following content:docker build -t signal-test:latest .docker run signal-test:latestINTis printed twice, thus indicating that two signals were sent to the process.