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
This commit is contained in:
Executable
+20
@@ -0,0 +1,20 @@
|
||||
#!/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"
|
||||
@@ -4,6 +4,8 @@ set -x
|
||||
RFB_PORT=59${DISPLAY_NUM}
|
||||
NOVNC_PORT=80${DISPLAY_NUM}
|
||||
|
||||
${SCRIPTS_HOME}/fetch_games.sh
|
||||
|
||||
echo Display at ${DISPLAY} with ${SCREEN_W}x${SCREEN_H}x24
|
||||
Xvnc ${DISPLAY} -geometry ${SCREEN_W}x${SCREEN_H} -depth 24 +xinerama -securitytypes none >/var/log/xvfb.log &
|
||||
fluxbox &
|
||||
|
||||
Reference in New Issue
Block a user