From f7353472ed8e448371de41b2f5e60491221af0e0 Mon Sep 17 00:00:00 2001 From: Midou36O Date: Sat, 3 Dec 2022 19:21:23 +0100 Subject: [PATCH] Hopefully it works. You can thank the drone docker dev for not providing a xbuild option. --- .woodpecker.yml | 4 ++++ Dockerfile-arm64 | 14 ++++++++++++++ 2 files changed, 18 insertions(+) create mode 100644 Dockerfile-arm64 diff --git a/.woodpecker.yml b/.woodpecker.yml index 6da7eb7..618d7bf 100644 --- a/.woodpecker.yml +++ b/.woodpecker.yml @@ -20,6 +20,7 @@ pipeline: from_secret: passwd # password = key or actual password tags: latest + dockerfile: Dockerfile-arm64 dockerize-arm64: environment: @@ -59,6 +60,7 @@ pipeline: dockerize-dev-arm64: environment: + - ARCH= - GOOS=linux - GOARCH=arm64 when: @@ -74,3 +76,5 @@ pipeline: from_secret: passwd # password = key or actual password tags: ${CI_COMMIT_SHA:0:8}-arm64 + dockerfile: Dockerfile-arm64 + # You can thank the drone docker maintainer for not providing a buildx option. \ No newline at end of file diff --git a/Dockerfile-arm64 b/Dockerfile-arm64 new file mode 100644 index 0000000..bcaf886 --- /dev/null +++ b/Dockerfile-arm64 @@ -0,0 +1,14 @@ +FROM arm64v8/golang:alpine AS build +WORKDIR /app +RUN apk add --no-cache git +RUN git clone https://codeberg.org/gothub/gothub . +RUN go mod download +RUN go build -ldflags "-X codeberg.org/gothub/gothub/pages.Version=$(git rev-parse --short HEAD)" + +FROM arm64v8/alpine:${ARCH} AS bin +WORKDIR /app +COPY --from=build /app/gothub . +COPY --from=build /app/public . +COPY --from=build /app/views . +CMD ["./gothub serve"] +EXPOSE 3000 \ No newline at end of file