Browse Source

Fix some minor oversights from https://github.com/docker-library/official-images/pull/1810

Tianon Gravi 9 years ago
parent
commit
31d6256106
2 changed files with 9 additions and 5 deletions
  1. 0 3
      Dockerfile
  2. 9 2
      test-pr.sh

+ 0 - 3
Dockerfile

@@ -26,11 +26,8 @@ ENV DIR /usr/src/official-images
 ENV PATH $DIR/bashbrew/go/bin:$PATH
 
 ENV BASHBREW_LIBRARY $DIR/library
-ENV BASHBREW_CACHE /bashbrew-cache
 
 WORKDIR $DIR
 COPY . $DIR
 
 RUN cd bashbrew/go && gb build
-
-VOLUME $BASHBREW_CACHE

+ 9 - 2
test-pr.sh

@@ -50,6 +50,11 @@ if [ -z "$BASHBREW_SECOND_STAGE" ]; then
 			# make sure our user in the container can read it
 			--group-add "$(stat -c '%g' "$BASHBREW_CACHE")"
 		)
+	else
+		args+=(
+			--tmpfs /bashbrew-cache
+			-e BASHBREW_CACHE=/bashbrew-cache
+		)
 	fi
 
 	args+=(
@@ -60,7 +65,6 @@ if [ -z "$BASHBREW_SECOND_STAGE" ]; then
 
 		-e BASHBREW_DEBUG
 		-e BASHBREW_SECOND_STAGE=1
-		-w /usr/src/pr
 	)
 
 	cmd=( /usr/src/official-images/test-pr.sh "$pull" "$@" )
@@ -75,9 +79,12 @@ if [ -d .git ]; then
 fi
 
 if [ "$pull" = '0' ]; then
-	cd "$(dirname "$(readlink -f "$BASH_SOURCE")")"
 	commit='FAKE'
 else
+	dir="$(mktemp -d)"
+	trap "rm -rf '$dir'" EXIT
+	cd "$dir"
+
 	# TODO we only have "git version 2.4.1" which doesn't support "clone -q" :(
 	git init -q .
 	git remote add origin https://github.com/docker-library/official-images.git