File tree Expand file tree Collapse file tree 2 files changed +5
-12
lines changed
Expand file tree Collapse file tree 2 files changed +5
-12
lines changed Original file line number Diff line number Diff line change 1- # We do not use --platform feature to auto fill this ARG because of incompatibility between podman and docker
2- ARG BUILDSCRIPT=
3- ARG LDFLAGS=
4- ARG TARGETPLATFORM=linux/amd64
5- ARG BUILDPLATFORM=linux/amd64
6- FROM --platform=$BUILDPLATFORM docker.io/library/node:18-alpine as web-builder
1+ ARG TARGETARCH
2+ FROM docker.io/library/node:18-alpine as web-builder
73
84USER node
95
106ARG BUILDSCRIPT
11- ARG TARGETPLATFORM
12- ARG TARGETARCH=amd64
137WORKDIR /opt/app-root
148
159COPY --chown=node web/package.json web/package.json
@@ -25,9 +19,8 @@ WORKDIR /opt/app-root/web
2519RUN npm run format-all
2620RUN npm run build$BUILDSCRIPT
2721
28- FROM --platform=$BUILDPLATFORM docker.io/library/golang:1.22 as go-builder
22+ FROM docker.io/library/golang:1.22 as go-builder
2923
30- ARG TARGETPLATFORM
3124ARG TARGETARCH=amd64
3225ARG LDFLAGS
3326WORKDIR /opt/app-root
@@ -41,7 +34,7 @@ COPY pkg/ pkg/
4134
4235RUN CGO_ENABLED=0 GOARCH=$TARGETARCH go build -ldflags "$LDFLAGS" -mod vendor -o plugin-backend cmd/plugin-backend.go
4336
44- FROM --platform=$TARGETPLATFORM registry.access.redhat.com/ubi9/ubi-minimal:9.4
37+ FROM --platform=linux/$TARGETARCH registry.access.redhat.com/ubi9/ubi-minimal:9.4
4538
4639COPY --from=web-builder /opt/app-root/web/dist ./web/dist
4740COPY --from=go-builder /opt/app-root/plugin-backend ./
Original file line number Diff line number Diff line change @@ -59,7 +59,7 @@ BUILD_FLAGS ?= -ldflags "${LDFLAGS}"
5959# build a single arch target provided as argument
6060define build_target
6161 echo 'building image for arch $(1 ) '; \
62- DOCKER_BUILDKIT=1 $(OCI_BIN ) buildx build --ulimit nofile=20480:20480 --load --build-arg LDFLAGS="${LDFLAGS}" --build-arg BUILDSCRIPT=${BUILDSCRIPT} --build-arg TARGETPLATFORM=linux/ $( 1 ) --build-arg TARGETARCH=$(1 ) --build-arg BUILDPLATFORM=linux/amd64 ${OCI_BUILD_OPTS} -t ${IMAGE}-$(1 ) -f Dockerfile .;
62+ DOCKER_BUILDKIT=1 $(OCI_BIN ) buildx build --ulimit nofile=20480:20480 --load --build-arg LDFLAGS="${LDFLAGS}" --build-arg BUILDSCRIPT=${BUILDSCRIPT} --build-arg TARGETARCH=$(1 ) ${OCI_BUILD_OPTS} -t ${IMAGE}-$(1 ) -f Dockerfile .;
6363endef
6464
6565# push a single arch target image
You can’t perform that action at this time.
0 commit comments