Skip to content

Instantly share code, notes, and snippets.

@motin
Last active January 20, 2017 10:05
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save motin/488998820e31f65c4ae01b4bf4d42146 to your computer and use it in GitHub Desktop.
Save motin/488998820e31f65c4ae01b4bf4d42146 to your computer and use it in GitHub Desktop.
Benchmark script related to https://github.com/docker/for-mac/issues/77
#!/usr/bin/env bash
set -o errexit
#set -x
echo "Benchmark - dd if=/dev/zero of=speedtest bs=1024 count=100000"
echo "* On host"
time dd if=/dev/zero of=speedtest bs=1024 count=100000
echo
echo "* Within Docker for Mac without a host volume"
docker run --rm -it alpine time dd if=/dev/zero of=speedtest bs=1024 count=100000
echo
echo "* Within Docker for Mac within a host volume"
docker run --rm -it -v "$(PWD):/pwd" -w /pwd alpine time dd if=/dev/zero of=speedtest bs=1024 count=100000
echo
echo "* Within Docker for Mac within a host volume using NFS"
export PWDNFS="${PWD/\/Users\/$USER//mnt}"
docker run --rm -it -v "$PWDNFS:/pwd" -w /pwd alpine time dd if=/dev/zero of=speedtest bs=1024 count=100000
exit 0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment