Docker container is killed after ~1 minute Docker container is killed after ~1 minute docker docker

Docker container is killed after ~1 minute


The problem is the yes | part.The Erlang VM behaves differently from regular programs when it comes to the stdin and input. It will buffer whatever input you throw at it, and with yes | you give it an infinite stream of yeses. Those yeses are buffered and memory grows until the process is killed by the system, because there's no more memory left.

It is generally a bad idea to use yes | with anything using Elixir/Erlang, even more so with long running tasks - with short running ones you have a chance at completing them before you run out of memory, but it's still not a great idea.


Not sure if this is still relevant but the whole infinite stream problem seems to be solved by just piping echo y.

ex:

echo y | mix compile

Although I'm not sure if there's something I'm missing that makes this a silly solution.

EDIT: this is probably betterhttps://stackoverflow.com/a/25921514