search

Home  >  Q&A  >  body text

dockerfile - docker 以-d模式启动时闪退的问题,docker桥接网络的问题

最近研究docker。遇到一些问题,希望高手指点
在docker安装好后。并启动docker后。在运行容器的时候出现了问题。当以-d参数以后端进程方式启动的时候。容器在启动的时候会断掉。

PHP中文网PHP中文网2778 days ago1065

reply all(1)I'll reply

  • 大家讲道理

    大家讲道理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

    reply
    0
  • Cancelreply