Created
February 10, 2017 22:01
-
-
Save tylerflint/2d64986a362ff2b8f929add7adeb586c to your computer and use it in GitHub Desktop.
mount /data to host mount to bypass docker layering, to achieve best throughput on data services
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 1 - copy the contents of /data from within the image onto the host share | |
docker run \ | |
-it \ | |
--rm \ | |
-v /var/nanobox/test-volume:/host \ | |
nanobox/mysql \ | |
bash -c "cp -a /data/* /host" | |
# 2 - run the real container with the host mount at /data | |
docker run \ | |
-it \ | |
--rm \ | |
-v /var/nanobox/test-volume:/data \ | |
nanobox/mysql \ | |
ls /data | |
# 3 - measure disk usage from directly from the host | |
du -sch /var/nanobox/test-volume | grep total | awk '{print $1}' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment