Skip to content

Instantly share code, notes, and snippets.

@clintkitson
Last active February 12, 2016 15:50
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save clintkitson/701373d87daa7343415a to your computer and use it in GitHub Desktop.
Save clintkitson/701373d87daa7343415a to your computer and use it in GitHub Desktop.
build and test volume drivers in docker using boot2docker and docker-machine form os x cli
docker-machine create --driver=virtualbox testing
docker-machine create --driver=virtualbox testing2
eval $(docker-machine env testing2)
docker-machine ssh testing2 "curl -sSL https://dl.bintray.com/emccode/rexray/install | sh -s staged"
docker-machine ssh testing2 "sudo tee -a /etc/rexray/config.yml << EOF
rexray:
logLevel: debug
storageDrivers:
- virtualbox
volume:
mount:
preempt: false
virtualbox:
endpoint: http://10.0.2.2:18083
tls: false
volumePath: /Users/clintonkitson/VirtualBox Volumes
controllerName: SATA
"
docker-machine ssh testing2 "sudo rexray start"
### build it
eval $(docker-machine env testing)
cd /go/src/github.com/docker/docker
docker run --privileged --rm -ti -v `pwd`:/go/src/github.com/docker/docker2 dockercore/docker \
/bin/bash -c \
"cd .. && mv docker docker-old && git clone file:////go/src/github.com/docker/docker2 docker && cd docker && \
hack/make.sh binary && \
cp bundles/1.11.0-dev/binary/docker-1.11.0-dev /go/src/github.com/docker/docker2/bundles/1.11.0-dev/binary/."
### integration test it only docker
eval $(docker-machine env testing)
cd /go/src/github.com/docker/docker
docker run --privileged --rm -ti -v `pwd`:/go/src/github.com/docker/docker2 dockercore/docker \
/bin/bash -c \
"cd .. && mv docker docker-old && git clone file:////go/src/github.com/docker/docker2 docker && cd docker && \
TESTFLAGS='-check.f DockerExternalVolumeSuite.TestExternalVolumeDriver*' hack/make.sh binary test-integration-cli"
### integration test it with rex
eval $(docker-machine env testing2)
docker-machine scp bundles/1.11.0-dev/binary/docker-1.11.0-dev testing2:~/docker
docker-machine ssh testing2 "sudo /etc/init.d/docker stop"
docker-machine ssh testing2 "sudo mv ~/docker /usr/local/bin/docker"
docker-machine ssh testing2 "sudo /etc/init.d/docker start"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment