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

Dockerfile STOPSIGNAL directive not working (but --stop-signal flag does) #19300

Closed
stund opened this issue Jan 13, 2016 · 6 comments
Closed
Assignees
Labels
kind/bug Bugs are bugs. The cause may or may not be known at triage time so debugging may be needed.

Comments

@stund
Copy link

stund commented Jan 13, 2016

$ docker version
Client:
 Version:      1.9.1
 API version:  1.21
 Go version:   go1.4.2
 Git commit:   a34a1d5
 Built:        Fri Nov 20 12:59:02 UTC 2015
 OS/Arch:      linux/amd64

Server:
 Version:      1.9.1
 API version:  1.21
 Go version:   go1.4.2
 Git commit:   a34a1d5
 Built:        Fri Nov 20 12:59:02 UTC 2015
 OS/Arch:      linux/amd64

$ docker info
Containers: 1
Images: 47
Server Version: 1.9.1
Storage Driver: aufs
 Root Dir: /var/lib/docker/aufs
 Backing Filesystem: extfs
 Dirs: 49
 Dirperm1 Supported: true
Execution Driver: native-0.2
Logging Driver: json-file
Kernel Version: 3.16.0-4-amd64
Operating System: Debian GNU/Linux 8 (jessie)
CPUs: 1
Total Memory: 3.625 GiB
Name: hooke
ID: Q4WH:WQ7X:VAAE:NQ47:I56W:LNLH:ZGUV:ARGX:IGBR:LQQY:WK4Y:5TUY
WARNING: No memory limit support
WARNING: No swap limit support

The --stop-signal flag to docker run works as expected, but the STOPSIGNAL directive does not.

Sample Dockerfile:

FROM busybox
STOPSIGNAL SIGINT

If I docker run the resulting image, docker inspect shows the StopSignal is still SIGTERM:

$ docker inspect 4736f241a55d | grep StopSignal
        "StopSignal": "SIGTERM"

But if I run it with --stop-signal SIGINT, inspect shows:

$ docker inspect cdb2fba79d15 | grep StopSignal
        "StopSignal": "SIGINT"
@buckett
Copy link

buckett commented Jan 26, 2016

With docker 1.9.1 I have the same issue, but I don't have any StopSignal listed at all in the output of docker inspect when the container is setup with docker-compose. Using the docker command directly I see the same results the reporter.

@runcom
Copy link
Member

runcom commented Jan 26, 2016

This is definitely fixed in the upcoming 1.10 version (I didn't test on 1.9)

$ docker build -t testss .
Sending build context to Docker daemon 2.048 kB
Step 1 : FROM fedora
 ---> 6547ce9b3407
Step 2 : STOPSIGNAL SIGINT
 ---> Running in 7b2b21008cf8
 ---> 88194b50bb11
Removing intermediate container 7b2b21008cf8
Successfully built 88194b50bb11

$ docker inspect testss | grep -i stopsignal
                "#(nop) STOPSIGNAL [SIGINT]"
            "StopSignal": "SIGINT"
            "StopSignal": "SIGINT"

$ cat Dockerfile 
FROM fedora
STOPSIGNAL SIGINT

@runcom
Copy link
Member

runcom commented Jan 26, 2016

ping @calavera

@stund
Copy link
Author

stund commented Feb 12, 2016

I tested in 1.10, but am still seeing the same issue.

Note that I'm running docker inspect on the running container's ID, not the image. The image does indeed show the correct StopSignal, but that's not being reflected when it's run.

@calavera calavera self-assigned this Feb 12, 2016
@thaJeztah thaJeztah added the kind/bug Bugs are bugs. The cause may or may not be known at triage time so debugging may be needed. label Feb 12, 2016
@AlekseyMartynov
Copy link

@runcom @calavera Is this fixed? Which milestone?

With Docker 1.10.3 and the following Dockerfile:

FROM busybox
CMD sleep 3600
STOPSIGNAL SIGKILL

docker stop $(docker run -d img1) - takes 10 sec and writes "failed to exit within 10 seconds of SIGTERM - using the force" to docker.log

docker stop $(docker run -d --stop-signal=SIGKILL img1) - exits immediately

@thaJeztah
Copy link
Member

@AlekseyMartynov that fix didn't make it into 1.10.3, so will be part of 1.11

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug Bugs are bugs. The cause may or may not be known at triage time so debugging may be needed.
Projects
None yet
Development

No branches or pull requests

6 participants