Skip to content

Commit

Permalink
Add workaround for overlayfs+nokogiri failures in the tests
Browse files Browse the repository at this point in the history
  • Loading branch information
tianon committed Jan 5, 2016
1 parent 99433d2 commit 554114c
Showing 1 changed file with 15 additions and 1 deletion.
16 changes: 15 additions & 1 deletion test/tests/run-in-container.sh
Original file line number Diff line number Diff line change
Expand Up @@ -29,4 +29,18 @@ WORKDIR $workdir
ENTRYPOINT ["$entrypoint"]
EOD

exec docker run --rm "$newImage" "$@"
args=( --rm )

# there is strong potential for nokogiri+overlayfs failure
# see https://github.com/docker-library/ruby/issues/55
gemHome="$(docker inspect -f '{{range .Config.Env}}{{println .}}{{end}}' "$newImage" | awk -F '=' '$1 == "GEM_HOME" { print $2; exit }')"
if [ "$gemHome" ]; then
# must be a Ruby image
driver="$(docker info | awk -F ': ' '$1 == "Storage Driver" { print $2; exit }')"
if [ "$driver" = 'overlay' ]; then
# let's add a volume (_not_ a bind mount) on GEM_HOME to work around nokogiri+overlayfs issues
args+=( -v "$gemHome/gems" )
fi
fi

exec docker run "${args[@]}" "$newImage" "$@"

0 comments on commit 554114c

Please sign in to comment.