Docker Detached Mode

前端 未结 3 1521
一整个雨季
一整个雨季 2021-01-30 03:30

What is detached mode in the docker world? I read this article Link, but it does not explain exactly what detached mode mean.

3条回答
  •  春和景丽
    2021-01-30 04:22

    You can start a docker container in detached mode with a -d option. So the container starts up and run in background. That means, you start up the container and could use the console after startup for other commands.

    The opposite of detached mode is foreground mode. That is the default mode, when -d option is not used. In this mode, the console you are using to execute docker run will be attached to standard input, output and error. That means your console is attached to the container's process.

    In detached mode, you can follow the standard output of your docker container with docker logs -f .

    Just try both options. I always use the detached mode to run my containers. I hope I could explain it a little bit clearer.

提交回复
热议问题