forked from epfl-lasa/mobile-throwing
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build-docker.sh
31 lines (23 loc) · 894 Bytes
/
build-docker.sh
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
#!/bin/bash
BASE_IMAGE_TAG=python3
IMAGE_NAME=darko_ms1_pybullet_throw
HELP_MESSAGE="Usage: ./build-docker.sh [-r] [-v]
Build a Docker container for remote development and/or running unittests.
Options:
-r, --rebuild Rebuild the image with no cache.
-v, --verbose Show all the output of the Docker
build process
-h, --help Show this help message.
"
BUILD_FLAGS=()
while [ "$#" -gt 0 ]; do
case "$1" in
-r|--rebuild) BUILD_FLAGS+=(--no-cache); shift 1;;
-v|--verbose) BUILD_FLAGS+=(--progress=plain); shift 1;;
-h|--help) echo "${HELP_MESSAGE}"; exit 0;;
*) echo "Unknown option: $1" >&2; echo "${HELP_MESSAGE}"; exit 1;;
esac
done
BUILD_FLAGS+=(--build-arg BASE_IMAGE_TAG="${BASE_IMAGE_TAG}")
BUILD_FLAGS+=(-t "${IMAGE_NAME}:${BASE_IMAGE_TAG}")
DOCKER_BUILDKIT=1 docker build "${BUILD_FLAGS[@]}" .