Last active
November 13, 2023 11:02
-
-
Save golgor/f0d222933a7f6d6e0ea5762447e08c2a to your computer and use it in GitHub Desktop.
Keep a docker container running forever
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Can be used as 'docker run --name=name container --entrypoint /entrypoint.sh' | |
while :; # Run an endless loop, | |
do :; # of do nothing, | |
done & # as background task. | |
kill -STOP $! # Stop the background task. | |
wait $! # Wait forever, because background task process has been stopped. | |
# Alternative is using the tail command. | |
# tail -f /dev/null |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
See @Stackoverflow1 or Stackoverflow2