mirror of
https://github.com/fabro-sh/fabro.git
synced 2026-10-06 02:48:25 +00:00
chore(docker): add --tag to docker-build.sh, document it in AGENTS.md
Lets a smoke-test harness pick its own image tag without racing the default fabro:latest, and points future agent sessions at bin/dev/docker-build.sh so they don't hand-roll a throwaway Dockerfile. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
parent
87dc7de140
commit
908f078cec
2 changed files with 12 additions and 2 deletions
|
|
@ -23,6 +23,10 @@ macOS note: if `cargo nextest run` fails with `Too many open files (os error 24)
|
|||
- `cd apps/fabro-web && bun run typecheck` — type check
|
||||
- `cd apps/fabro-web && bun run build` — production build
|
||||
|
||||
### Docker image
|
||||
- `bin/dev/docker-build.sh` — builds the local Docker image from the current tree using the release pipeline's cargo-zigbuild approach. Honors `--arch amd64|arm64`, `--tag <name>` (default `fabro`), and `--compile-only` (stages `docker-context/<arch>/fabro` without `docker build`). Prefer this over writing a throwaway Dockerfile; the release pipeline, `Dockerfile`, and this script share the same binary layout.
|
||||
- Refresh the embedded SPA before rebuilding the image after any `apps/fabro-web` change: `scripts/refresh-fabro-spa.sh` runs the bun build and copies `dist/` into `lib/crates/fabro-spa/assets/`. Skipping this step produces a Docker image whose Rust binary embeds a stale SPA bundle.
|
||||
|
||||
### Marketing site (apps/marketing)
|
||||
- `cd apps/marketing && bun run dev` — start Astro dev server
|
||||
- `cd apps/marketing && bun run build` — production build
|
||||
|
|
|
|||
|
|
@ -9,6 +9,7 @@
|
|||
# Usage:
|
||||
# bin/dev/docker-build.sh # host arch, build image at end
|
||||
# bin/dev/docker-build.sh --arch amd64 # force amd64 (uses QEMU on non-amd64 hosts — slow)
|
||||
# bin/dev/docker-build.sh --tag fabro:smoke # tag image as fabro:smoke (default: fabro)
|
||||
# bin/dev/docker-build.sh --arch arm64 --compile-only
|
||||
# # stage binary only; skip `docker build`
|
||||
# # (useful for multi-arch buildx verification)
|
||||
|
|
@ -19,12 +20,17 @@ cd "$(dirname "$0")/../.."
|
|||
|
||||
arch=""
|
||||
compile_only=0
|
||||
tag="fabro"
|
||||
while [ $# -gt 0 ]; do
|
||||
case "$1" in
|
||||
--arch)
|
||||
arch="$2"
|
||||
shift 2
|
||||
;;
|
||||
--tag)
|
||||
tag="$2"
|
||||
shift 2
|
||||
;;
|
||||
--compile-only)
|
||||
compile_only=1
|
||||
shift
|
||||
|
|
@ -90,5 +96,5 @@ if [ "$compile_only" -eq 1 ]; then
|
|||
exit 0
|
||||
fi
|
||||
|
||||
echo "Building Docker image..."
|
||||
docker build --platform "linux/$arch" -t fabro .
|
||||
echo "Building Docker image as $tag..."
|
||||
docker build --platform "linux/$arch" -t "$tag" .
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue