Skip to content

Instantly share code, notes, and snippets.

@tylerflint
Created February 10, 2017 22:01
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 tylerflint/2d64986a362ff2b8f929add7adeb586c to your computer and use it in GitHub Desktop.
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
# 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