Skip to content

Instantly share code, notes, and snippets.

@philipz
Created August 27, 2015 08:45
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save philipz/47b076de5cc468ff2c16 to your computer and use it in GitHub Desktop.
Save philipz/47b076de5cc468ff2c16 to your computer and use it in GitHub Desktop.
Docker Volume Driver Plugin for Ceph RBD

Getting Started With the Docker RBD Volume Plugin rbd-docker-plugin

docker run -it --rm \
--privileged \
--name rbd-docker-plugin \
--net host \
--volume /dev:/dev \
--volume /sys:/sys \
--volume /etc/ceph:/etc/ceph \
--volume /run/docker/plugins:/run/docker/plugins \
--volume /var/lib/docker/volumes:/var/lib/docker/volumes \
base/archlinux /bin/bash -c "
pacman-key --refresh-keys
pacman --noconfirm -Syy
pacman --noconfirm -S ceph go git gcc xfsprogs
export GOPATH=\$HOME/go
export PATH=\$PATH:\$GOPATH/bin
go get github.com/yp-engineering/rbd-docker-plugin
go get github.com/Soulou/curl-unix-socket
RBD_DOCKER_PLUGIN_DEBUG=1 rbd-docker-plugin \
--create --config /etc/ceph/ceph.conf"
[0] ~ >> docker run -it --rm --volume-driver=rbd --volume foo:/mnt/foo centos:7 /bin/bash -c "echo -n 'Hello ' >> /mnt/foo/hello"
[0] ~ >> docker run -it --rm --volume-driver=rbd --volume foo:/mnt/foo centos:7 /bin/bash -c "echo 'world' >> /mnt/foo/hello"
[0] ~ >> docker run -it --volume-driver=rbd --volume foo:/mnt/foo centos:7 /bin/bash -c "cat /mnt/foo/hello"
Hello world
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment