Skip to content

Commit 3abc341

Browse files
committed
fix
1 parent 7774745 commit 3abc341

File tree

2 files changed

+19
-9
lines changed

2 files changed

+19
-9
lines changed

.github/workflows/build_default.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff 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: |

Github/Runners/alpine.dockerfile

Lines changed: 18 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2,17 +2,26 @@
22
#------------------------------------------------------------------------------------#
33
ARG 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
1114
ADD /tmp/alpine-minirootfs-loongarch64.tar.gz /
12-
13-
FROM loongarch64-base AS loongarch64
1415
RUN 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
1827
CMD ["/bin/sh"]

0 commit comments

Comments
 (0)