summaryrefslogtreecommitdiff
path: root/ci/run-docker.sh
diff options
context:
space:
mode:
authorAlex Crichton <alex@alexcrichton.com>2016-11-16 14:12:12 -0800
committerAlex Crichton <alex@alexcrichton.com>2016-11-17 11:30:17 -0800
commitc2842463e5257cba51db549351abb0c70ba3ef6f (patch)
tree8790d03306f3a7d6055240da78cafc3016e65114 /ci/run-docker.sh
parenta3baaf6a9562ac9a37d03807cdbc15cba5fc34fb (diff)
downloadrust-libc-c2842463e5257cba51db549351abb0c70ba3ef6f.tar.gz
Share the host's `target` directory for tests
This helps caching between runs and can help speed up turnaround time for various operations. The old android container didn't work out for some reason due to permissions so the definition has now been vendored locally to just rebuild it each time.
Diffstat (limited to 'ci/run-docker.sh')
-rw-r--r--ci/run-docker.sh17
1 files changed, 12 insertions, 5 deletions
diff --git a/ci/run-docker.sh b/ci/run-docker.sh
index e34e65ffcd..a7702ae1dc 100644
--- a/ci/run-docker.sh
+++ b/ci/run-docker.sh
@@ -6,14 +6,21 @@ set -ex
run() {
echo $1
docker build -t libc ci/docker/$1
+ mkdir -p target
docker run \
+ --user `id -u`:`id -g` \
--rm \
- -v `rustc --print sysroot`:/rust:ro \
- -v `pwd`:/checkout:ro \
- -e CARGO_TARGET_DIR=/tmp/target \
- -w /checkout \
+ --volume $HOME/.cargo:/cargo \
+ --env CARGO_HOME=/cargo \
+ --volume `rustc --print sysroot`:/rust:ro \
+ --volume `pwd`:/checkout:ro \
+ --volume `pwd`/target:/checkout/target \
+ --env CARGO_TARGET_DIR=/checkout/target \
+ --workdir /checkout \
--privileged \
- -it libc \
+ --interactive \
+ --tty \
+ libc \
ci/run.sh $1
}