Skip to content

Instantly share code, notes, and snippets.

@luhn
Created November 9, 2015 19:11
Show Gist options
  • Save luhn/74105e2e6b00af93d5d9 to your computer and use it in GitHub Desktop.
Save luhn/74105e2e6b00af93d5d9 to your computer and use it in GitHub Desktop.
#!/bin/sh
set -e
touch /tmp/linked
ln -s /tmp/linked . || true
cat <<EOF > Dockerfile
FROM busybox:ubuntu-14.04
ADD . /data
CMD ["/bin/cat", "/data/volatilefile.txt"]
EOF
cat <<EOF > volatilefile.txt
volatile-orig
EOF
docker build -t test .
cat <<EOF > volatilefile.txt
volatile-updated
EOF
docker build -t test .
# now the test. should work on docker < 1.9.0 and break with docker = 1.9.0
output=`docker run --rm test || true`
if [ "${output}" != "volatile-updated" ]
then
echo "BUG: output was '${output}', expected 'volatile-updated'"
exit 1
else
echo "OK: output was '${output}', same as expected"
exit 0
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment