Recommened way of stopping Stardog running in a docker container

We start Stardog with docker like this:

docker run --name stardog7 --restart always -d -v /var/opt/stardog7:/var/opt/stardog -v /opt/stardog7/server/ext:/opt/stardog/server/ext -p 5806:5806 -p 5827:5820 -e STARDOG_SERVER_JAVA_ARGS="-Xmx24g -Xms24g -XX:MaxDirectMemorySize=64g

What is the recommened way of stopping Stardog running in a docker container? Is it sufficient to run

docker stop stardog7; docker rm stardog7

or should we run stardog-admin in the container to stop stardog before stopping the container? It seems like we sometimes loose some configuration data when we just stop and remove the container.

Kind regards,


Stardog should handle the SIGTERM sent by docker upon the stop command being issued. By default, Docker will send a SIGKILL after 10 seconds. To avoid a potential hard shutdown, you can use -t to increase the number of seconds that Docker waits after the SIGTERM. The safest solution, is as you mentioned, running stardog-admin shutdown in the container first before stopping the underlying container.

I am curious as to the configuration loss you mentioned and if that is a config change just before shutdown, or any other circumstances that caused a config loss.