Docker Flashes When Starting in -d Mode, docker Bridge Network

  docker, question

A recent study of docker. In case of some problems, I hope that the experts can give me some advice.
After docker is installed. After starting docker. There was a problem running the container. When starting with the -d parameter as a backend process. The container will break when it is started.图片描述

图片描述

This is because the container exited immediately after it was started.

If you want to get a shell, you should execute:

docker run -it centos /bin/bash

If you want to run in the background, you need to start a process that will not be suspended, such as:

docker run -d centos /usr/bin/supervisord

If you want to start a shell with daemon, docker cannot do it, see this question:

http://segmentfault.com/q/1010000000424935