joeduffy / blocker

A simple AWS EBS volume plugin for Docker
Apache License 2.0
82 stars 13 forks source link

Integrate with docker compose and Mountpoint #6

Open indicalabs opened 8 years ago

indicalabs commented 8 years ago

How to integrated blocker in docker compose? Can we set a mountpoint instead of using the entire EBS volume as one mountpoint?

joeduffy commented 7 years ago

Compose integration should work, as this is how I've been running my cluster for some time. Basically, just create a volume in the usual way, but use "blocker" as the driver; e.g.

version: "2"
services:
    something:
        image: x/y
        volumes:
            - "my-volume:/somewhere/on/disk"
volumes:
    my-volume:
        driver: blocker
        driver_opts:
            volume_id: <ebs-vol-id>

In order for this to work (and not error out with a "blocker driver not found" when spinning up containers), you need to ensure the Blocker service is running on all Swarm nodes (see README).

The idea of a mountpoint is very interesting. That isn't supported yet, however it's a great feature request. Let's use this work item to track it. Thanks for suggesting!