forked from Linaro/squad
-
Notifications
You must be signed in to change notification settings - Fork 0
/
dev-docker
executable file
·41 lines (34 loc) · 1.14 KB
/
dev-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
37
38
39
40
41
#!/bin/sh
set -eu
basedir="$(readlink -f "$(dirname $0)")"
tmpdir="$basedir"/tmp
datadir="$tmpdir"/data
mkdir -p "$datadir"
dockerfile="$datadir"/../Dockerfile.dev
(
sed -e '1,/# Prepare the environment/!d' "$basedir"/Dockerfile
echo 'RUN apt-get install -q2 snakefood flake8 python3-django-extensions python3-django-debug-toolbar ipython3 rabbitmq-server chromium nodejs ruby-foreman procps && \'
echo " groupadd -g $(id -g) $(id -gn) && \\"
echo " useradd -m -u $(id -u) -g $(id -g) -s /bin/bash ${USER}"
echo "RUN pip3 install --no-dependencies zipp importlib-metadata==3.1.1 asgiref django-bootstrap3"
echo "WORKDIR /app"
echo "USER ${USER}"
echo 'CMD ["bash"]'
) > "$dockerfile"
docker build -t squad/dev -f "$dockerfile" .
extra_volumes=''
for v in $HOME/.gitconfig $HOME/.config/git; do
if [ -e "$v" ]; then
extra_volumes="$extra_volumes --volume=$v:$v"
fi
done
exec docker run \
--env=XDG_DATA_HOME=/app/tmp/data \
--env=SQUAD_EXCLUDE_TEST_TAGS=skip_sqlite \
--publish=8000:8000 \
--volume="$basedir":/app \
--name=squad-dev-docker \
--hostname=squad-dev-docker \
$extra_volumes \
--rm \
-it squad/dev "$@"