最近研究docker。遇到一些问题,希望高手指点 在docker安装好后。并启动docker后。在运行容器的时候出现了问题。当以-d参数以后端进程方式启动的时候。容器在启动的时候会断掉。
认证0级讲师
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
This is probably because the container exited immediately after it was started.
If you want to get a shell, you should execute:
If you want to run in the background, you need to start a process that will not hang, such as:
If you want to start a shell as a daemon, docker cannot do it. You can refer to this question:
/q/1010000000424935