Skip to content

Commit 11dd0a3

Browse files
committed
Add --no-cache flag to dev-build.bash for full rebuilds.
1 parent 1f614a8 commit 11dd0a3

File tree

1 file changed

+18
-2
lines changed

1 file changed

+18
-2
lines changed

brev/dev-build.bash

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,29 @@
33
# This script builds Docker containers for tutorials.
44
#
55
# Usage:
6-
# ./dev-build.bash <tutorial-name>
6+
# ./dev-build.bash [--no-cache] [<tutorial-name>]
77
#
88
# If a tutorial name is provided (e.g., "accelerated-python"), only that tutorial is built.
99
# If no argument is provided, all tutorials are built.
10+
#
11+
# Options:
12+
# --no-cache Rebuild the image from scratch, ignoring the Docker layer cache.
1013

1114
set -eu
1215

16+
NO_CACHE=""
17+
while [[ $# -gt 0 ]]; do
18+
case ${1} in
19+
--no-cache)
20+
NO_CACHE="--no-cache"
21+
shift
22+
;;
23+
*)
24+
break
25+
;;
26+
esac
27+
done
28+
1329
SCRIPT_PATH=$(cd $(dirname ${0}); pwd -P)
1430
REPO_ROOT=$(cd ${SCRIPT_PATH}/..; pwd -P)
1531

@@ -39,7 +55,7 @@ build_tutorial() {
3955
echo "Dockerfile generated successfully"
4056
fi
4157

42-
docker compose --progress=plain -f "${ACH_TUTORIAL_PATH}/brev/docker-compose.yml" build
58+
docker compose --progress=plain -f "${ACH_TUTORIAL_PATH}/brev/docker-compose.yml" build ${NO_CACHE}
4359

4460
echo "Successfully built image for ${ACH_TUTORIAL}"
4561
echo ""

0 commit comments

Comments
 (0)