File tree Expand file tree Collapse file tree 2 files changed +19
-9
lines changed
Expand file tree Collapse file tree 2 files changed +19
-9
lines changed Original file line number Diff line number Diff line change @@ -189,6 +189,7 @@ jobs:
189189 context : /tmp/DOCKERFILES/
190190 file : " /tmp/DOCKERFILES/alpine.dockerfile"
191191 platforms : " linux/${{ matrix.platform }}"
192+ target : ${{ matrix.platform == 'loong64' && 'final-loong64' || 'final' }}
192193 build-args : |
193194 TARGETARCH=${{ matrix.platform }}
194195 tags : |
Original file line number Diff line number Diff line change 22# ------------------------------------------------------------------------------------#
33ARG TARGETARCH=amd64
44
5- # Stage for official Alpine images (aarch64, riscv64, x86_64)
6- FROM alpine:edge AS official
7- RUN apk add --no-cache ca-certificates tzdata
5+ # Default base stage for most architectures
6+ FROM alpine:edge AS base-stage
7+ ARG TARGETARCH
8+ RUN if [ "$TARGETARCH" != "loong64" ]; then \
9+ apk add --no-cache ca-certificates tzdata; \
10+ fi
811
9- # Stage for loongarch64 using local rootfs file
10- FROM scratch AS loongarch64 -base
12+ # Special base for loong64
13+ FROM scratch AS loong64 -base
1114ADD /tmp/alpine-minirootfs-loongarch64.tar.gz /
12-
13- FROM loongarch64-base AS loongarch64
1415RUN apk add --no-cache ca-certificates tzdata
1516
16- # Final stage - select based on architecture
17- FROM ${TARGETARCH} AS final
17+ # Final conditional stage
18+ FROM base-stage AS final
19+ ARG TARGETARCH
20+ RUN if [ "$TARGETARCH" = "loong64" ]; then \
21+ echo "Error: Use loong64-base target for loong64 architecture" && exit 1; \
22+ fi
23+ CMD ["/bin/sh" ]
24+
25+ # Dedicated final stage for loong64
26+ FROM loong64-base AS final-loong64
1827CMD ["/bin/sh" ]
You can’t perform that action at this time.
0 commit comments