Auto-detect platform by default; use DOCKER_DEFAULT_PLATFORM for cross-compile targets
Remove hardcoded platform from compose file so plain 'make up' (or 'docker compose up --build') always builds natively for the host. Explicit targets (up-arm64, up-armv7, etc.) set DOCKER_DEFAULT_PLATFORM.
This commit is contained in:
parent
0fecb9a4fe
commit
00da63ec80
2 changed files with 12 additions and 12 deletions
|
|
@ -1,32 +1,33 @@
|
||||||
# HIY — docker compose helpers
|
# HIY — docker compose helpers
|
||||||
# Usage: make <target>
|
# Usage: make <target>
|
||||||
#
|
#
|
||||||
# Supported platforms
|
# Default (make up) — auto-detects the host platform.
|
||||||
# up-amd64 — x86-64 (Mac Intel, Linux desktop, CI)
|
|
||||||
# up-arm64 — ARM 64-bit (Mac M1/M2/M3, Pi 4 / Pi 5 running 64-bit OS)
|
|
||||||
# up-armv7 — ARM 32-bit v7 (Pi 2 / Pi 3 / Pi 4 running 32-bit OS)
|
|
||||||
# up-armv6 — ARM 32-bit v6 (Pi Zero, Pi 1)
|
|
||||||
#
|
#
|
||||||
# The default target builds for linux/amd64 (same as 'up-amd64').
|
# Explicit cross-compile targets:
|
||||||
|
# up-amd64 / up-x64 / up-win — linux/amd64 (Mac Intel, Windows, Linux x86)
|
||||||
|
# up-arm64 — linux/arm64 (Mac M1/M2/M3, Pi 4/5 64-bit OS)
|
||||||
|
# up-armv7 — linux/arm/v7 (Pi 2/3/4 32-bit OS)
|
||||||
|
# up-armv6 — linux/arm/v6 (Pi Zero, Pi 1)
|
||||||
|
|
||||||
COMPOSE = docker compose
|
COMPOSE = docker compose
|
||||||
UP = $(COMPOSE) up --build
|
UP = $(COMPOSE) up --build
|
||||||
|
|
||||||
.PHONY: up up-amd64 up-x64 up-win up-arm64 up-armv7 up-armv6 down logs
|
.PHONY: up up-amd64 up-x64 up-win up-arm64 up-armv7 up-armv6 down logs
|
||||||
|
|
||||||
up: up-amd64
|
up:
|
||||||
|
$(UP)
|
||||||
|
|
||||||
up-amd64 up-x64 up-win:
|
up-amd64 up-x64 up-win:
|
||||||
PLATFORM=linux/amd64 $(UP)
|
DOCKER_DEFAULT_PLATFORM=linux/amd64 $(UP)
|
||||||
|
|
||||||
up-arm64:
|
up-arm64:
|
||||||
PLATFORM=linux/arm64 $(UP)
|
DOCKER_DEFAULT_PLATFORM=linux/arm64 $(UP)
|
||||||
|
|
||||||
up-armv7:
|
up-armv7:
|
||||||
PLATFORM=linux/arm/v7 $(UP)
|
DOCKER_DEFAULT_PLATFORM=linux/arm/v7 $(UP)
|
||||||
|
|
||||||
up-armv6:
|
up-armv6:
|
||||||
PLATFORM=linux/arm/v6 $(UP)
|
DOCKER_DEFAULT_PLATFORM=linux/arm/v6 $(UP)
|
||||||
|
|
||||||
down:
|
down:
|
||||||
$(COMPOSE) down
|
$(COMPOSE) down
|
||||||
|
|
|
||||||
|
|
@ -18,7 +18,6 @@ services:
|
||||||
|
|
||||||
# ── Control plane ─────────────────────────────────────────────────────────
|
# ── Control plane ─────────────────────────────────────────────────────────
|
||||||
server:
|
server:
|
||||||
platform: ${PLATFORM:-linux/amd64}
|
|
||||||
build:
|
build:
|
||||||
context: ..
|
context: ..
|
||||||
dockerfile: infra/Dockerfile.server
|
dockerfile: infra/Dockerfile.server
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue