Files
docker-dosbox-novnc/scripts/fetch_games.sh
T
jensandClaude Sonnet 5 44bbd00336 Fetch games into a volume at runtime instead of baking them into the image
927MB of the image was just t7g's two CD ISOs, which can't be meaningfully
compressed (already-compressed FMV/audio). Move the smbget/unzip step out
of the Dockerfile and into scripts/fetch_games.sh, run from server.sh on
container start: it populates GAMES_HOME on first run and skips the fetch
if games are already present. run.sh mounts a named volume so the games
survive --rm restarts instead of being re-downloaded every time. Image
drops from 1.6GB to ~690MB; first container start now needs network access
to the vlda-01 SMB share to seed the volume.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01NiNnj78HGx1KWyCCo39HSz
2026-07-28 08:25:26 +02:00

21 lines
461 B
Bash
Executable File

#!/usr/bin/env bash
set -e
SMB_BASE="smb://vlda-01/software/Games/dosbox"
GAME_ZIPS="stuntcar.zip t7g.zip"
if [ -n "$(ls -A "${GAMES_HOME}" 2>/dev/null)" ]; then
echo "Games already present in ${GAMES_HOME}, skipping fetch"
exit 0
fi
echo "Fetching games into ${GAMES_HOME}..."
TMPDIR=$(mktemp -d)
trap 'rm -rf "${TMPDIR}"' EXIT
cd "${TMPDIR}"
for zip in ${GAME_ZIPS}; do
smbget -au "${SMB_BASE}/${zip}"
done
unzip -o -d "${GAMES_HOME}" "*.zip"