File tree Expand file tree Collapse file tree 3 files changed +27
-21
lines changed Expand file tree Collapse file tree 3 files changed +27
-21
lines changed Original file line number Diff line number Diff line change 1- ARG TARGETARCH
2- FROM docker.io/library/node:18-alpine as web-builder
3-
4- USER node
5-
6- ARG BUILDSCRIPT
7- WORKDIR /opt/app-root
8-
9- COPY --chown=node web/package.json web/package.json
10- COPY --chown=node web/package-lock.json web/package-lock.json
11- WORKDIR /opt/app-root/web
12- RUN CYPRESS_INSTALL_BINARY=0 npm --legacy-peer-deps ci
13-
14- WORKDIR /opt/app-root
15- COPY --chown=node web web
16- COPY mocks mocks
17-
18- WORKDIR /opt/app-root/web
19- RUN npm run format-all
20- RUN npm run build$BUILDSCRIPT
1+ FROM localhost/local-front-build:latest as web-builder
212
3+ ARG TARGETARCH
224FROM docker.io/library/golang:1.23 as go-builder
235
246ARG TARGETARCH=amd64
Original file line number Diff line number Diff line change 1+ FROM docker.io/library/node:18-alpine as web-builder
2+
3+ USER node
4+
5+ ARG BUILDSCRIPT
6+ WORKDIR /opt/app-root
7+
8+ COPY --chown=node web/package-lock.json web/package-lock.json
9+ COPY --chown=node web/package.json web/package.json
10+ WORKDIR /opt/app-root/web
11+ RUN CYPRESS_INSTALL_BINARY=0 npm --legacy-peer-deps ci
12+
13+ WORKDIR /opt/app-root
14+ COPY --chown=node web web
15+ COPY mocks mocks
16+
17+ WORKDIR /opt/app-root/web
18+ RUN npm run format-all
19+ RUN npm run build$BUILDSCRIPT
20+
21+ FROM scratch
22+
23+ COPY --from=web-builder /opt/app-root/web/dist /opt/app-root/web/dist
Original file line number Diff line number Diff line change @@ -50,7 +50,7 @@ CMDLINE_ARGS ?= --loglevel trace --config config/config.yaml
5050# build a single arch target provided as argument
5151define build_target
5252 echo 'building image for arch $(1 ) '; \
53- 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 .;
53+ DOCKER_BUILDKIT=1 $(OCI_BIN ) buildx build --load --build-arg LDFLAGS="${LDFLAGS}" --build-arg TARGETARCH=$(1 ) ${OCI_BUILD_OPTS} -t ${IMAGE}-$(1 ) -f Dockerfile .;
5454endef
5555
5656# push a single arch target image
@@ -196,6 +196,7 @@ serve-mock: YQ ## Run backend using mocks
196196# note: to build and push custom image tag use: IMAGE_ORG=myuser VERSION=dev make images
197197.PHONY : image-build
198198image-build : # # Build MULTIARCH_TARGETS images
199+ $(OCI_BIN ) build --ulimit nofile=20480:20480 --build-arg BUILDSCRIPT=${BUILDSCRIPT} ${OCI_BUILD_OPTS} -t localhost/local-front-build:latest -f Dockerfile.front .
199200 trap ' exit' INT; \
200201 $(foreach target,$(MULTIARCH_TARGETS ) ,$(call build_target,$(target ) ) )
201202
You can’t perform that action at this time.
0 commit comments