Skip to content
This repository has been archived by the owner on Dec 22, 2024. It is now read-only.

Add --stop-timeout to the run command #9

Open
Joly0 opened this issue Aug 24, 2023 · 0 comments
Open

Add --stop-timeout to the run command #9

Joly0 opened this issue Aug 24, 2023 · 0 comments

Comments

@Joly0
Copy link

Joly0 commented Aug 24, 2023

As described here https://docs-stage.docker.com/engine/reference/commandline/run/#stop-timeout it is possible to add --stop-timeout to define a custom timeout for the docker container, that "overrides" the default 10 seconds.

Some extra information on how this got implemented in other projects is found here https://youtrack.jetbrains.com/issue/JT-61434

This should fix the problem described here https://github.com/imagegenius/docker-amp#application-setup when the container receives the stop signal. Though i am not sure, if --stop-signal is needed and what it should be set to ( i guess it needs to be SIGTERM as thats the signal that is handled internally in the docker container).

So to sum this up, an adjusted docker run command should look like this:

docker run -d \
  --name=amp \
  --mac-address=00:00:00:00:00:00 \
  -e PUID=1000 \
  -e PGID=1000 \
  -e TZ=Etc/UTC \
  -e USERNAME=admin \
  -e PASSWORD=admin \
  -e LICENCE=00000000-0000-0000-0000-000000000000 \
  -e JAVA_VERSIONS=7,9,13 `#optional` \
  -e MODULE=ADS `#optional` \
  -p 8080:8080 \
  -p 25565:25565 `#optional` \
  -v path_to_appdata:/config \
  --restart unless-stopped \
  --stop-timeout=60 \
  --stop-signal=SIGTERM \
  ghcr.io/imagegenius/amp:latest

Stop timeout should be high enough with 60 seconds to gracefully shutdown all running instances, but it could also be decreased to 45 or even 30 seconds

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant