Skip to content

Commit fb46327

Browse files
committed
fix podman builds
1 parent 96729c2 commit fb46327

File tree

2 files changed

+5
-12
lines changed

2 files changed

+5
-12
lines changed

Dockerfile

Lines changed: 4 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,9 @@
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

84
USER node
95

106
ARG BUILDSCRIPT
11-
ARG TARGETPLATFORM
12-
ARG TARGETARCH=amd64
137
WORKDIR /opt/app-root
148

159
COPY --chown=node web/package.json web/package.json
@@ -25,9 +19,8 @@ WORKDIR /opt/app-root/web
2519
RUN npm run format-all
2620
RUN 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
3124
ARG TARGETARCH=amd64
3225
ARG LDFLAGS
3326
WORKDIR /opt/app-root
@@ -41,7 +34,7 @@ COPY pkg/ pkg/
4134

4235
RUN 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

4639
COPY --from=web-builder /opt/app-root/web/dist ./web/dist
4740
COPY --from=go-builder /opt/app-root/plugin-backend ./

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ BUILD_FLAGS ?= -ldflags "${LDFLAGS}"
5959
# build a single arch target provided as argument
6060
define 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 .;
6363
endef
6464

6565
# push a single arch target image

0 commit comments

Comments
 (0)