joeduffy / blocker

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

implement volume tag detection to support services in Swarm mode #7

Open chanwit opened 7 years ago

chanwit commented 7 years ago

This PR implements tag detection in an EBS volume in a form of service=<name>. If matches, it will retrieve the volume id for the plugin to mount. With this PR, we are allowed to provision something like a stateful MySQL Galera cluster with a Docker service.

Example use case:

  1. Tag a volume with "service=myservice".
  2. Run the following command.
    sudo docker service create --name test \
    --log-driver=journald \
    --mount "type=volume,volume-driver=blocker,src=db,target=/root,volume-opt=service=myservice" \
    alpine top

Signed-off-by: Chanwit Kaewkasi chanwit@gmail.com