-
Notifications
You must be signed in to change notification settings - Fork 18.6k
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
[Swarm mode] Define signals used to stop containers for updates #25696
Comments
Thanks for suggesting; |
Cheers @thaJeztah! |
My $.02 - consider making the signal # to use for stopping a container/service part of the Dockerfile rather than being part of the command to create the container/service. The Dockerfile sets the boundary and the termination signal expected of the installed software is part of the boundary, not of any particular instance. This way, the knowledge belongs where it is defined (i.e., with the software being encapsulated); it will travel together with the image, just like the exposed ports and command. |
+1 |
I realised I didn't mention that here, but although you cannot override the stop-signal when creating a service, if an image should always be stopped with a specific stop-signal; you can define the stop-signal in the Dockerfile (using the FROM httpd:2.2
STOPSIGNAL WINCH Docker services will take that into account when stopping the container;
|
I think |
@aluzzardi Yes I agree. Here is a tracking issue to get feedback: #30634 |
Oh well in that case... :) |
Oops didn't mean to close :) |
Added a PR #30754 and a SwarmKit PR moby/swarmkit#1924 for |
This fix tries to update the SwarmKit from ed384f3 to 6bc357e The following is the list of docker related changes: 1. Took long time for Docker Swarm service turn desired state from Ready to Running (Issue moby#28291) 2. Native Swarm in 1.12 - panic: runtime error: index out of range (Issue moby#25608) 3. Global mode target replicas keep increasing (Issue moby#30854) 4. Creating service with publish mode=host and without published port crashes swarm manager (Issue moby#30938) 5. Define signals used to stop containers for updates (Issue moby#25696) (PR moby#30754) This fix fixes moby#28291, moby#25608, moby#30854, moby#30938. This fix is required by PR moby#30754. Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
I'm not sure, but I suspect docker does a
docker stop
(ie. sending a SIGTERM to a container, and then a SIGKILL after waiting 10 seconds) when performing "rolling updates" on aservice
. With some images, like [https://hub.docker.com/_/httpd/](those powered by apache2), this is actually a destructive (non-graceful) way to stop containers, since apache needs aSIGWINCH
to actually shutdown in a graceful way.It would be awesome if we could define a signal used to stop services when creating them, for example:
docker service create --stop-signal SIGWINCH --name my-apache-container httpd:latest
The text was updated successfully, but these errors were encountered: