mirror of
https://gitea.com/Lydanne/buildx.git
synced 2025-05-28 00:17:42 +08:00
Fix Dockerfile format
Signed-off-by: Kang HuaiShuai <khs1994@khs1994.com>
This commit is contained in:
parent
ab5fe3dec5
commit
aed531a8a9
@ -142,7 +142,7 @@ $ docker buildx build --platform linux/amd64,linux/arm64 .
|
||||
Finally, depending on your project, the language that you use may have good support for cross-compilation. In that case, multi-stage builds in Dockerfiles can be effectively used to build binaries for the platform specified with `--platform` using the native architecture of the build node. List of build arguments like `BUILDPLATFORM` and `TARGETPLATFORM` are available automatically inside your Dockerfile and can be leveraged by the processes running as part of your build.
|
||||
|
||||
```
|
||||
FROM --platform $BUILDPLATFORM golang:alpine AS build
|
||||
FROM --platform=$BUILDPLATFORM golang:alpine AS build
|
||||
ARG TARGETPLATFORM
|
||||
ARG BUILDPLATFORM
|
||||
RUN echo "I am running on $BUILDPLATFORM, building for $TARGETPLATFORM" > /log
|
||||
|
Loading…
x
Reference in New Issue
Block a user