Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Docker's
kill
event is emitted whendocker stop ID
is used. In a real world scenario where this becomes very useful is when load balancing between containers using nginx-proxy. If the application within the container is watching forSIGTERM
, it can instead hold itself open for any specific amount of time to finish in progress connections. NGINX on the other hand will remove the container from it's configuration to prevent any new requests from coming in, but will still hold the in progress connections until they finish (or when the container gives up and shuts down).Docker at the moment doesn't have a
State
variable to define when a container is in progress of shutting down. In this case I've addedKilling
to theState
struct that's defaulted to false that only flips to true when thekill
event is emitted. Then is handled when generating the file.