Body: <p>We are talking about Docker containers as sysdig, consul, fluentd, mesos-slave, etc. that we are running on almost all machines. </p>
  
  <p>Currently we are using Ubuntu's Upstart and CoreOS's Fleetctl. We're migrating to Ubuntu 18.04 LTS and currently considering whether to convert the configuration to:</p>
  
  <ul>
  <li>Systemd or</li>
  <li>Docker-compose</li>
  </ul>
  
  <p>Systemd can do health checks and automatically bring back processes that died back online. It's also the most similar to Upstart that we use heavily. Our Upstart configuration files are generated from cloud-config like this:</p>
  
  <pre><code>- &gt;
      /usr/local/bin/generate-docker-upstart fluentd registry/fluentd:1.0.1
      -e HOST=elasticsearch
      -e PORT=9200
      -e INDEX=fluentd
      -e NODE=`hostname -s`
      -e ROLE=app
      -e ENVIRONMENT={{Ref:Environment}}
      -e TENANT={{Ref:Tenant}}
      -p 24224:24224
      --name \$NAME \$IMAGE
  </code></pre>
  
  <p>We use AWS CloudFormation to bring the virtual machines online.</p>
  
  <p>We cannot use a real container orchestration framework (we already use Marathon/Mesos) because these services have to be running on each host and before Marathon/Mesos run.</p>
  
  <p>What solution makes most sense? Convert these files to systemd or start using docker-compose, despite already using Marathon on Mesos?</p>
  
Comments: CC BY-SA 4.0
Comments: 2018-09-24T22:45:52.980Z
Comments: If you do decide to use systemd, make sure to group them into a .target as you will probably want to address them all at once without expressly enumerating them at some point. (man 5 systemd.target)
Comments: Jiri Klouda
Comments: CC BY-SA 4.0
Comments: 2019-12-23T09:23:16.643Z
Comments: @JiriKlouda Could you post an answer?
Comments: 030
Tags: <docker><docker-compose><systemd>
Title: Should I use systemd or docker-compose to replace Upstart for keeping Docker containers running on my systems?
UserDisplayName: ujjain
ThreadText: # Should I use systemd or docker-compose to replace Upstart for keeping Docker containers running on my systems?
  
  (Asked by: username_0 on 2018-09-24)
  
  We are talking about Docker containers as sysdig, consul, fluentd, mesos-slave, etc. that we are running on almost all machines.
  
  Currently we are using Ubuntu's Upstart and CoreOS's Fleetctl. We're migrating to Ubuntu 18.04 LTS and currently considering whether to convert the configuration to:
  
  * Systemd or
  * Docker-compose
  
  Systemd can do health checks and automatically bring back processes that died back online. It's also the most similar to Upstart that we use heavily. Our Upstart configuration files are generated from cloud-config like this:
  
  ```
  - >
      /usr/local/bin/generate-docker-upstart fluentd registry/fluentd:1.0.1
      -e HOST=elasticsearch
      -e PORT=9200
      -e INDEX=fluentd
      -e NODE=`hostname -s`
      -e ROLE=app
      -e ENVIRONMENT={{Ref:Environment}}
      -e TENANT={{Ref:Tenant}}
      -p 24224:24224
      --name \$NAME \$IMAGE
  
  ```
  
  We use AWS CloudFormation to bring the virtual machines online.
  
  We cannot use a real container orchestration framework (we already use Marathon/Mesos) because these services have to be running on each host and before Marathon/Mesos run.
  
  What solution makes most sense? Convert these files to systemd or start using docker-compose, despite already using Marathon on Mesos?
  
  **Tags:** docker, docker-compose, systemd
  
  > **Comments:**
  > **username_1**: If you do decide to use systemd, make sure to group them into a .target as you will probably want to address them all at once without expressly enumerating them at some point. (man 5 systemd.target)  
  > **username_2**: @username_1 Could you post an answer?  
  
  ---
  
  ## 0 answers
  
  