@@ -37,7 +37,8 @@ export UKC_METRO="dummy-metro-for-local-run"
3737
3838
3939# Local-friendly Chrome flags (less restrictive than cloud) + custom DevTools frontend
40- export CHROMIUM_FLAGS=" --user-data-dir=/home/kernel/user-data --disable-dev-shm-usage --start-maximized --remote-allow-origins=* --no-sandbox --disable-setuid-sandbox --custom-devtools-frontend=http://localhost:8001/"
40+ # Note: --user-data-dir will be set automatically by start-chromium.sh using CHROMIUM_DATA_DIR
41+ export CHROMIUM_FLAGS=" --disable-dev-shm-usage --start-maximized --remote-allow-origins=* --no-sandbox --disable-setuid-sandbox --custom-devtools-frontend=http://localhost:8001/"
4142
4243echo " 🔧 Configuration:"
4344echo " Image: $IMAGE "
@@ -56,12 +57,24 @@ echo "🏃 Starting extended container with kernel-images run system..."
5657# Source common build vars
5758source ../../shared/ensure-common-build-run-vars.sh chromium-headful
5859
59- # Directory on host where recordings will be saved
60+ # Directory on host where recordings will be saved
6061HOST_RECORDINGS_DIR=" $SCRIPT_DIR /recordings"
6162mkdir -p " $HOST_RECORDINGS_DIR "
6263
64+ # Optional Chromium data directory for persistence
65+ # Set CHROMIUM_DATA_HOST to enable volume mounting (e.g., ./chromium-data)
66+ if [[ -n " ${CHROMIUM_DATA_HOST:- } " ]]; then
67+ echo " 🗂️ Using persistent Chromium data directory: $CHROMIUM_DATA_HOST "
68+ mkdir -p " $CHROMIUM_DATA_HOST "
69+ CHROMIUM_DATA_VOLUME=" -v $( realpath " $CHROMIUM_DATA_HOST " ) :/data"
70+ else
71+ echo " 🔄 Using ephemeral Chromium data (no persistence)"
72+ CHROMIUM_DATA_VOLUME=" "
73+ fi
74+
6375# Build Chromium flags file and mount
64- CHROMIUM_FLAGS_DEFAULT=" --user-data-dir=/home/kernel/user-data --disable-dev-shm-usage --disable-gpu --start-maximized --disable-software-rasterizer --remote-allow-origins=*"
76+ # Note: --user-data-dir will be set automatically by start-chromium.sh using CHROMIUM_DATA_DIR
77+ CHROMIUM_FLAGS_DEFAULT=" --disable-dev-shm-usage --disable-gpu --start-maximized --disable-software-rasterizer --remote-allow-origins=*"
6578if [[ " $RUN_AS_ROOT " == " true" ]]; then
6679 CHROMIUM_FLAGS_DEFAULT=" $CHROMIUM_FLAGS_DEFAULT --no-sandbox --no-zygote"
6780fi
@@ -92,6 +105,11 @@ RUN_ARGS=(
92105 --mount type=bind,src=" $FLAGS_FILE " ,dst=/chromium/flags,ro
93106)
94107
108+ # Add Chromium data volume if specified
109+ if [[ -n " $CHROMIUM_DATA_VOLUME " ]]; then
110+ RUN_ARGS+=( $CHROMIUM_DATA_VOLUME )
111+ fi
112+
95113# Add URLS environment variable if provided
96114if [[ -n " ${URLS:- } " ]]; then
97115 echo " URLs: $URLS "
0 commit comments