Home  >  Q&A  >  body text

dcoker-compose - docker-compose加了 -d 参数后启动容器还是处于exit 0 状态

我的yaml文件如下:

version: '2'
services:
  foo:
    image: ubuntu:latest
    container_name: demo_ubuntu

运行命令:

sudo docker-compose up -d

启动的容器状态为exit 0,不是正常的up状态

求解答~

黄舟黄舟2758 days ago780

reply all(3)I'll reply

  • 高洛峰

    高洛峰2017-04-24 09:13:28

    Just add the startup command, such as /bin/bash

    reply
    0
  • PHP中文网

    PHP中文网2017-04-24 09:13:28

    I found that using the redis mirror can keep the up state, but ubuntu cannot. I wonder who can explain this situation

    reply
    0
  • 大家讲道理

    大家讲道理2017-04-24 09:13:28

    You can refer to https://github.com/sequenceiq...

    reply
    0
  • Cancelreply