I'm making a devops script that runs
docker-compose run --no-deps my_service
For the sole reason of running diagnostic operations in the container, without running the actual container command. (Since it might be resource-intensive, or might fail altogether.)
I figured I'll override the entrypoint with some kind of no-op that runs forever.
The runs forever part is important, because if I'll just use echo or cat or anything, the process will finish immediately and I won't be able to use docker exec on my container.
I tried
--entrypoint "tail -f /dev/null"
But no luck. It seems that --entrypoint doesn't let you enter arguments for your command.
Do you know whether that's supposed to be possible or not?
Another funny hack I tried which kind of worked is --entrypoint yes which made the entrypoint be Linux's yes utility, which just output y in an infinite loop.
This worked fine for 2 hours, until I ran out of harddrive space and had to delete everything.
If you've got an idea for a common Linux command like yes that just waits forever, and doesn't print an infinite amount of text, let me know.