Why docker container exits immediately

后端 未结 15 2365
温柔的废话
温柔的废话 2020-11-22 13:42

I run a container in the background using

 docker run -d --name hadoop h_Service

it exits quickly. But if I run in the foreground, it works

15条回答
  •  萌比男神i
    2020-11-22 14:29

    This did the trick for me:

    docker run -dit ubuntu
    

    After it, I checked for the processes running using:

    docker ps -a
    

    For attaching again the container

    docker attach CONTAINER_NAME
    

    TIP: For exiting without stopping the container type: ^P^Q

提交回复
热议问题