3 # execute from project root
4 # environment varables:
5 # IMAGE: name of the docker image to use
6 # TARGETS: targets to pass to `make` inside the container
7 # PASS_ENV: names of environment variables to import into
8 # the container during build
10 IMAGE="${IMAGE:-archlinux-build}"
14 if [[ "$TARGETS" == *codecov* ]]; then
15 local_conf="$local_conf $(bash <(curl -s https://codecov.io/env))"
18 if [ -e scripts/docker/"${IMAGE}"/env ]; then
19 local_conf="$local_conf --env-file scripts/docker/${IMAGE}/env"
22 docker build -t "blank/${IMAGE}" scripts/docker/"${IMAGE}"
23 docker run -v "$PWD":/repo ${local_conf} "blank/${IMAGE}" /bin/bash -c "cd /repo && make -j\$(nproc) $TARGETS"