Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
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