Container stops upon exit from the terminal


I’m only starting with Docker.

I observed Docker’s behaviour of which I’m not sure whether it is expected.

  1. I start a container in an interactive mode (-i) with a terminal (-t);
  2. I execute docker attach <container_id> ;
  3. I’m in the container’s terminal executing commands;
  4. I type exit to go back to host’s shell;
  5. The container is no longer running.

I’m not sure why would exiting a container’s terminal stop the whole container. I would be grateful for advice on how to be able to exit containers’ terminals without stopping them.

Hi Lukasz,

To exit a container and to leave it running use: CTRL-p CTRL-q




It seems that the page has been invalidated…


Sorry, we can’t find that page

We tried to forward you to where we think you might be going, but we couldn’t find a good match. You’ve got some choices: