Along with having something along the lines of : ENTRYPOINT ["tail", "-f", "/dev/null"]
in your docker file, you should also run the docker container with -td
option. This is particularly useful when the container runs on a remote m/c. Think of it more like you have ssh'ed into a remote m/c having the image and started the container. In this case, when you exit the ssh session, the container will get killed unless it's started with -td
option. Sample command for running your image would be: docker run -td <any other additional options> <image name>
This holds good for docker version 20.10.2