From 547eb16b8d7a4054054a97b798feff79f141aeb0 Mon Sep 17 00:00:00 2001 From: Jakob Borg Date: Wed, 14 Jun 2023 09:18:04 +0200 Subject: [PATCH] wip --- .github/workflows/build-syncthing.yaml | 2 +- Dockerfile | 9 ++++++--- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/.github/workflows/build-syncthing.yaml b/.github/workflows/build-syncthing.yaml index 97f8ebd36..134a7cbe8 100644 --- a/.github/workflows/build-syncthing.yaml +++ b/.github/workflows/build-syncthing.yaml @@ -649,7 +649,7 @@ jobs: - name: Build binaries run: | for arch in arm64 amd64; do - go run build.go -goarch "$arch" build syncthing + go run build.go -goos linux -goarch "$arch" build syncthing mv syncthing syncthing-linux-"$arch" done env: diff --git a/Dockerfile b/Dockerfile index 646656f17..463b26405 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,5 +1,4 @@ ARG GOVERSION=latest -ARG TARGETARCH # # Maybe build Syncthing. This is a bit ugly as we can't make an entire @@ -11,15 +10,18 @@ ARG TARGETARCH FROM golang:$GOVERSION AS builder ARG BUILD_USER ARG BUILD_HOST +ARG TARGETARCH WORKDIR /src COPY . . ENV CGO_ENABLED=0 +RUN echo syncthing-linux-$TARGETARCH RUN if [ ! -f syncthing-linux-$TARGETARCH ] ; then \ + echo syncthing-linux-$TARGETARCH ; \ go run build.go -no-upgrade build syncthing ; \ - fi && \ - mv syncthing syncthing-linux-$TARGETARCH + mv syncthing syncthing-linux-$TARGETARCH ; \ + fi # # The rest of the Dockerfile uses the binary from the builder, prebuilt or @@ -27,6 +29,7 @@ RUN if [ ! -f syncthing-linux-$TARGETARCH ] ; then \ # FROM alpine +ARG TARGETARCH EXPOSE 8384 22000/tcp 22000/udp 21027/udp