Skip to main content
This is a pre-production deployment of Warehouse. Changes made here affect the production instance of PyPI (pypi.python.org).
Help us improve Python packaging - Donate today!

Docker Volume Utility

Project Description

docker-volume - Docker Volume Utility

INSTALL

$ pip install docker-volume

HOW TO USE IT

configuration

$REPO_ROOT/config/volume.yml

volumes:
  mysql:
    hostpath: ${here}/../volumes/mysql/
    vboxpath: /var/lib/mysql
    uid: 0
    gid: 0
    dmode: 777
  mongo:
    hostpath: ${here}/../volumes/mongo/
    vboxpath: /var/lib/mongo
    uid: 0
    gid: 0
    dmode: 777
  redis:
    hostpath: ${here}/../volumes/redis/
    vboxpath: /var/lib/redis
    uid: 0
    gid: 0
    dmode: 777

add volume

$ docker-volume add dev
EXECUTE: VBoxManage sharedfolder add dev --name docker-example_redis --hostpath /Users/sximada/ng/var/src/develop/docker-example/volumes/redis
EXECUTE: VBoxManage sharedfolder add dev --name docker-example_mysql --hostpath /Users/sximada/ng/var/src/develop/docker-example/volumes/mysql
EXECUTE: VBoxManage sharedfolder add dev --name docker-example_mongo --hostpath /Users/sximada/ng/var/src/develop/docker-example/volumes/mongo

Mount volume

Start docker machine.

$ docker-machine start dev
(dev) Starting VM...
Machine "dev" was started.
Started machines may have new IP addresses. You may need to re-run the `docker-machine env` command.

mount volume.

$ docker-volume mount dev
EXECUTE: docker-machine ssh dev "sudo mkdir -p /var/lib/mysql &&  sudo mount -t vboxsf -o uid=0,gid=0,dmode=777 docker-example_mysql /var/lib/mysql"
EXECUTE: docker-machine ssh dev "sudo mkdir -p /var/lib/mongo &&  sudo mount -t vboxsf -o uid=0,gid=0,dmode=777 docker-example_mongo /var/lib/mongo"
EXECUTE: docker-machine ssh dev "sudo mkdir -p /var/lib/redis &&  sudo mount -t vboxsf -o uid=0,gid=0,dmode=777 docker-example_redis /var/lib/redis"

Make sure that it is mounted.

$ docker-machine ssh dev "mount | grep /var/lib"
/dev/sda1 on /mnt/sda1/var/lib/docker/aufs type ext4 (rw,relatime,data=ordered)
none on /var/lib/mongo type vboxsf (rw,nodev,relatime)
none on /var/lib/redis type vboxsf (rw,nodev,relatime)
none on /var/lib/mysql type vboxsf (rw,nodev,relatime)

Unmount volume

Unmount volume.

$ docker-volume unmount dev
EXECUTE: docker-machine ssh dev "sudo umount /var/lib/redis"
EXECUTE: docker-machine ssh dev "sudo umount /var/lib/mysql"
EXECUTE: docker-machine ssh dev "sudo umount /var/lib/mongo"

Make sure that it is unmounted.

$ docker-machine ssh dev "mount | grep /var/lib"
/dev/sda1 on /mnt/sda1/var/lib/docker/aufs type ext4 (rw,relatime,data=ordered)

Remove volume

Stop docker machine.

$ docker-machine stop dev
(dev) Stopping VM...
Machine "dev" was stopped.

Remove volume.

$ docker-volume remove dev
EXECUTE: VBoxManage sharedfolder remove dev --name docker-example_mongo
EXECUTE: VBoxManage sharedfolder remove dev --name docker-example_mysql
EXECUTE: VBoxManage sharedfolder remove dev --name docker-example_redis

Volume name

Volume name is ${REPOSITORY_DIRECTORY_NAME}_${VOLUME_NAME}.

Release History

Release History

History Node

0.4.post1

History Node

0.4

History Node

0.3

History Node

0.3.dev1

History Node

0.3.dev0

History Node

0.2.dev1

History Node

0.1.dev3

History Node

0.1.dev2

History Node

0.1.dev1

This version
History Node

0.1.dev0

Download Files

Download Files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

File Name & Checksum SHA256 Checksum Help Version File Type Upload Date
docker_volume-0.1.dev0-py3-none-any.whl (12.2 kB) Copy SHA256 Checksum SHA256 3.5 Wheel Jan 13, 2016
docker-volume-0.1.dev0.tar.gz (7.4 kB) Copy SHA256 Checksum SHA256 Source Jan 13, 2016

Supported By

WebFaction WebFaction Technical Writing Elastic Elastic Search Pingdom Pingdom Monitoring Dyn Dyn DNS Sentry Sentry Error Logging CloudAMQP CloudAMQP RabbitMQ Heroku Heroku PaaS Kabu Creative Kabu Creative UX & Design Fastly Fastly CDN DigiCert DigiCert EV Certificate Rackspace Rackspace Cloud Servers DreamHost DreamHost Log Hosting