ci: use pre-built APK in Docker image instead of compiling from source
Build and Publish Arch Package / build-arch (amd64, x86_64) (push) Has been cancelled
Build and Publish Arch Package / build-arch (arm64, aarch64) (push) Has been cancelled
Build and Publish Docker Image / build-apk (amd64, x86_64) (push) Successful in 46s
Build and Publish Docker Image / build-apk (arm64, aarch64) (push) Successful in 51s
Build and Publish Docker Image / build-and-push-docker (push) Failing after 11m58s

This commit is contained in:
2026-04-14 00:59:31 +02:00
parent 21a01e9412
commit b5ef107f9c
3 changed files with 87 additions and 90 deletions
+9 -19
View File
@@ -1,25 +1,15 @@
FROM golang:1.25-alpine AS builder
WORKDIR /app
ENV GOTOOLCHAIN=local
COPY src/go.mod src/go.sum ./
RUN go mod download
COPY src/ ./
RUN CGO_ENABLED=0 GOOS=$TARGETOS GOARCH=$TARGETARCH \
go build -ldflags="-s -w" -trimpath -o /ax .
FROM alpine:latest
RUN apk --no-cache add ca-certificates
ARG VERSION
ARG TARGETARCH
RUN apk --no-cache add ca-certificates && \
ARCH=$([ "$TARGETARCH" = "arm64" ] && echo aarch64 || echo x86_64) && \
wget -q "https://g.eliaskohout.de/api/packages/eliaskohout/alpine/edge/main/${ARCH}/axolotl-${VERSION}-r0.apk" \
-O /tmp/axolotl.apk && \
apk add --no-cache --allow-untrusted /tmp/axolotl.apk && \
rm /tmp/axolotl.apk
WORKDIR /data
COPY --from=builder /ax /usr/local/bin/ax
EXPOSE 7000
ENTRYPOINT ["ax", "serve"]