Using "tail -f /dev/null" to keep container up fails unexpectedly

docker, ubuntu-14.04

Solution

Here is better way to keep the container running

sleep infinity

Problem

I'm using the `tail -f /dev/null` command to keep a container up. The line itself is placed in a script with an echo before and after. The echo under the `tail -f /dev/null` is expected to be unreachable but for some reason I see it in the logs. Once the issue occurs every restart to the container will cause the container to start and complete. Only a rm and rebuild solves this issue. I'm not sure if it is connected but one of the things I noticed that stopping and starting the computer in a very short interval helped me reproduce the issue. Under what circumstances could `tail -f /dev/null` continue to the next line? Base image: ubuntu 64x, 14.0.4 Computer OS: ubuntu 64x, 14.0.4

Original source

Related problems