-
Notifications
You must be signed in to change notification settings - Fork 2
/
run-distro-docker
36 lines (29 loc) · 1 KB
/
run-distro-docker
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
#!/bin/bash
set -e
if [ "$#" -lt 1 ]; then
echo "incorrect number of parameters" >&2
echo "usage: run-distro-docker distro [cmds]" >&2
exit 1
fi
script_dir="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
distro="$1"
# This hack with the home directory is because the build of the policy-tool is
# not sandboxed and cabal is putting dependencies in the home directory. If the
# home directory is not mounted to something persistant the dependencies have to
# be rebuilt everytime when building in a docker image.
mkdir -p $script_dir/build-homes/$distro
shift
docker run --rm -i -t \
-e PATH=$PATH \
-u `id -u`:`id -g` \
-e HOME=$script_dir/build-homes/$distro \
-e DISTDIR=$DISTDIR \
-e DOWNLOAD_CACHE=$DOWNLOAD_CACHE \
-e DOVER=$DOVER \
-e RISCV=$DOVER \
$DOCKER_RUN_ARGS \
-v $script_dir/..:$script_dir/.. \
-v $DOVER:$DOVER \
-v $DOWNLOAD_CACHE:$DOWNLOAD_CACHE \
-w $script_dir/ \
isp-build-$distro:latest "$@"