/docker-volume-unionmount

:whale: Docker Union Mount Volume Plugin

Primary LanguageGoApache License 2.0Apache-2.0

Docker Union Mount Volume Plugin

This is a docker plugin that facilitates creating union mounts as docker volumes by taking advantage of docker's graph driver. It's mostly useful in testing/staging/review areas where having the latest production data and being able to manipulate it, in a carefree manner, is necessary to test features and migrations.

Supported filesystems are:

  • AUFS
  • Overlay

Installation

Using go get:

$ go get -u http://github.com/Fardinak/docker-volume-unionmount

Usage

  1. Run the daemon

    $ docker-volume-unionmount
    

    Available arguments:

    • -root is the root directory for union mount driver's operations and volumes (defaults to /var/lib/docker-volumes/_unionmount/)
    • -defaultfs is the default filesystem for this driver's volumes (defaults to docker's storage driver or aufs)
  2. Create a named volume with the driver

    $ docker volume create --driver unionmount -o layers=/path/to/newer/clone:/var/lib/postgresql/data pgsandbox_data
    

    Available options:

    • layers absolute path to layers of the union, from top to bottom, separated by colons :. The upper layer will be automatically generated by the driver. (Required)
    • filesystem is the filesystem for this volume (defaults to driver's -defaultfs option)
  3. Use the volume in one or more containers

    $ docker run -it --rm -v pgsandbox_data:/var/lib/postgresql/data postgres:latest psql
    

TODOs

  • Filesystems as separate drivers (perhpase use docker's own graphdriver library)
  • Support multilayer with Overlay
  • Support Overlay2
  • Logging (logrus) and Debugging mode

Also: Review mounting other named volumes as layers to a union

License

Docker Union Mount Volume Plugin is licensed under the Apache License, Version 2.0. See LICENSE for the full license text.