Docker Community Forums

Share and learn in the Docker community.

Support for Compose

(Shadysql) #1

Expected behavior

Expected to have docker compose installed to deploy compose apps

Actual behavior

docker-compose doesnt work.

Additional Information

Steps to reproduce the behavior

  1. …Deploy the cluster via the cloudformation
  2. …SSH into the Leader node and run docker-compose…output is: ~
    $ docker-compose
    -sh: docker-compose: not found

(Michael Friis) #2

Hi, thanks for posting!

docker-compose is not an optimal fit for use with Docker 1.12 swarm:

  1. Containers started with docker-compose up will only be scheduled on the manager you’re logged in to, and not be spread to workers or other managers in the swarm
  2. There’s no way to ensure containers started with compose stay up. Containers that go down won’t be rescheduled if they go down or if the node they’re on dies.

I’d recommend using docker service create instead, or looking at DAB files:

If still you want to use docker-compose, you can set up an SSH tunnel and use your local compose, you could fetch the compose binary or you could run compose in a container: