Skip to content

Instantly share code, notes, and snippets.

@golgor
Last active November 13, 2023 11:02
Show Gist options
  • Save golgor/f0d222933a7f6d6e0ea5762447e08c2a to your computer and use it in GitHub Desktop.
Save golgor/f0d222933a7f6d6e0ea5762447e08c2a to your computer and use it in GitHub Desktop.
Keep a docker container running forever
# 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
@golgor
Copy link
Author

golgor commented Nov 13, 2023

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment