最近研究docker。遇到一些问题,希望高手指点
在docker安装好后。并启动docker后。在运行容器的时候出现了问题。当以-d参数以后端进程方式启动的时候。容器在启动的时候会断掉。
大家讲道理2017-04-21 11:19:33
This is probably 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 hang, such as:
docker run -d centos /usr/bin/supervisord
If you want to start a shell as a daemon, docker cannot do it. You can refer to this question:
/q/1010000000424935