Bug #77818 [Com]: When run through Docker, the process does not exit after a Ctrl+C SIGINT
| From: | secteurhack at gmail dot com | Date: | Tue, 02 Feb 2021 16:05:05 +0000 |
| Subject: | Bug #77818 [Com]: When run through Docker, the process does not exit after a Ctrl+C SIGINT | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-231889@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=77818&edit=1
ID: 77818
Comment by: secteurhack at gmail dot com
Reported by: sarkedev+php at gmail dot com
Summary: When run through Docker, the process does not exit
after a Ctrl+C SIGINT
Status: Open
Type: Bug
Package: CGI/CLI related
Operating System: Linux Ubuntu bionic
PHP Version: 7.3.3
Block user comment: N
Private report: N
New Comment:
This is not PHP related. You need to forwards signals to your container.
See: https://stackoverflow.com/a/66012590/1941316
Previous Comments:
------------------------------------------------------------------------
[2019-03-29 02:42:31] sarkedev+php at gmail dot com
Description:
------------
I'll use this simple example to illustrate the problem, but it could be any script that might
be stuck.
php -r 'while(1) sleep(1);'
This can be killed with Ctrl+C.
docker run -it php:cli php -r 'while(1) sleep(1);'
This can't be killed with Ctrl+C. It's also not possible to kill in the shell inside the
container, and it can also not be killed by killing the parent docker process. Only the root on the
host can kill it.
Test script:
---------------
docker run -it php:cli php -r 'while(1) sleep(1);'
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=77818&edit=1