mirror of
https://github.com/Kpa-clawbot/meshcore-analyzer.git
synced 2026-06-04 22:01:25 +00:00
## Summary Plain `docker build .` (no buildx) fails immediately: ``` Step 1/45 : FROM --platform=$BUILDPLATFORM golang:1.22-alpine AS builder failed to parse platform : "" is an invalid component of "": platform specifier component must match "^[A-Za-z0-9_-]+$" ``` `$BUILDPLATFORM` is only auto-populated by buildx; under plain BuildKit/`docker build` it's empty. ## Fix Add `ARG BUILDPLATFORM=linux/amd64` before the `FROM` so the variable always resolves. ## Multi-arch preserved `docker buildx build --platform=linux/arm64,linux/amd64 .` still overrides `BUILDPLATFORM` at invocation time — the ARG default only applies when the caller doesn't set one. The existing CI multi-arch workflow is unaffected. Fixes #884 Co-authored-by: meshcore-bot <bot@meshcore.local>
This commit is contained in:
@@ -1,5 +1,8 @@
|
||||
# Build stage always runs natively on the builder's arch ($BUILDPLATFORM)
|
||||
# and cross-compiles to $TARGETOS/$TARGETARCH via Go toolchain. No QEMU.
|
||||
# BUILDPLATFORM is auto-set by buildx; default to linux/amd64 so plain
|
||||
# `docker build` (without buildx) doesn't fail on an empty platform string.
|
||||
ARG BUILDPLATFORM=linux/amd64
|
||||
FROM --platform=$BUILDPLATFORM golang:1.22-alpine AS builder
|
||||
|
||||
ARG APP_VERSION=unknown
|
||||
|
||||
Reference in New Issue
Block a user