Skip to content

Optimized Docker build script for faster rebuilds#16

Merged
Xeeynamo merged 2 commits intoXeeynamo:mainfrom
maciej-trebacz:feat/cached-build
Jan 6, 2026
Merged

Optimized Docker build script for faster rebuilds#16
Xeeynamo merged 2 commits intoXeeynamo:mainfrom
maciej-trebacz:feat/cached-build

Conversation

@maciej-trebacz
Copy link
Contributor

This script creates a cache for Go modules, significantly speeding up the Docker build (from ~40 seconds to ~3s)

@decomp-dev
Copy link

decomp-dev bot commented Dec 28, 2025

Report for us (91868eb - 02cef32)

[!] Report not found. Did the build succeed?

Comment on lines 11 to 19
exec docker run --rm --platform=linux/amd64 \
-v "$(pwd)":/ff7 \
-v ff7_venv:/ff7/.venv \
-v "$(pwd)/build":/ff7/build \
-v "$HOME/.cache/ff7-go-mod":/gocache/mod \
-v "$HOME/.cache/ff7-go-build":/gocache/build \
-e "GOMODCACHE=/gocache/mod" \
-e "GOCACHE=/gocache/build" \
ff7-build:latest -lc "cd /ff7 && $*"
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

./Dockerfile
# 2. launch container and mount current directory under /ff7
# docker run --name ff7-work -it -v $(pwd):/ff7 -v ff7_venv:/ff7/.venv -v ff7_build:/ff7/build ff7-build

Let's integrate these flags from the original Dockerfile instructions:

  • --name ff7-work: useful for docker start -ai ff7-work
  • -v ff7_build:/ff7/build: useful to produce the binaries on the host

In addition I suggest to:

  • -v go_cache:/gocache: instead of mounting ~/.cache to avoid writing files on the host. For Docker on macOS, it's faster to have large cache volumes within the Docker VM than mapped from the host. This also allows to remove mkdir -p ~/.cache/ff7-go-mod ~/.cache/ff7-go-build.
  • -e "GOMODCACHE=/gocache/mod" and similar: shall we move these two env variables in the Dockerfile? So tools/docker-build.sh gets leaner.
  • Let's update the Dockerfile instructions in the comments to point to this newer shell script!

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

-v ff7_build:/ff7/build: useful to produce the binaries on the host

In the original PR I've opted for mounting the build directory to the one in the project root on the host, it made it very easy to test built images, but this works too.

CLAUDE.md Outdated
@@ -0,0 +1,360 @@
## FF7 Decomp: Working Notes for Agents
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's not have the agent instructions merged in main for now (see feedback here: #17 (comment))

Copy link
Owner

@Xeeynamo Xeeynamo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, thanks! And sorry for the late review

@Xeeynamo Xeeynamo merged commit 3a25bae into Xeeynamo:main Jan 6, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants