dnephin / dobi

A build automation tool for Docker applications
https://dnephin.github.io/dobi/
Apache License 2.0
311 stars 36 forks source link

Containers are stopped immediately after run #101

Closed OnkelTem closed 7 years ago

OnkelTem commented 7 years ago

Why does it stop my project immediately?

dobi.yaml:

compose=dev:
  files: [docker-compose.yml, docker-compose.override.yml]
  project: '{env.PROJECT}'
[local]$ dobi dev
[WARN] meta.project is not set. Using default "docker".
[compose:up dev] docker-compose.yml,docker-compose.override.yml project up
Creating myproject_db_1 ...
Creating myproject_mail_1 ...
Creating myproject_mail_1
Creating myproject_db_1 ... done
Creating myproject_web_1 ...
Creating myproject_web_1 ... done
[compose:up dev] docker-compose.yml,docker-compose.override.yml Done
[compose:up dev] docker-compose.yml,docker-compose.override.yml project stop
Stopping myproject_web_1  ... done
Stopping myproject_db_1   ... done
Stopping myproject_mail_1 ... done
[compose:up dev] docker-compose.yml,docker-compose.override.yml Done
dnephin commented 7 years ago

Hello, thanks for trying out dobi!

The default action for the compose resource is to run docker-compose up -d as setup, and when the task execution is done, run docker-compose stop. The idea is to setup an environment to run other tasks against.

If you'd like to keep the environment running you can use dobi dev:attach will work run docker-compose up and no teardown logic, but that keeps dobi in the foreground.

Currently there's no action to run docker-compose up -d and have it keep running. That might be a good thing to add.

I should also document this behaviour properly in the docs.

dnephin commented 7 years ago

I've opened #102 to add a dev:detach for running docker-compose up -d without any shutdown. It will be in the 0.10 release, and you can try it out by grabbing the binaries from circleci at https://circleci.com/gh/dnephin/dobi/571#artifacts/containers/0 under home/ubuntu/dobi/dist/bin/

OnkelTem commented 7 years ago

@dnephin

Many thanks for the quick reply. This behavior definitely makes sense. Gonna check out #102 result now