This commit is contained in:
Jakob Borg 2023-06-14 09:18:04 +02:00
parent a241e3cb90
commit 547eb16b8d
2 changed files with 7 additions and 4 deletions

View File

@ -649,7 +649,7 @@ jobs:
- name: Build binaries - name: Build binaries
run: | run: |
for arch in arm64 amd64; do 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" mv syncthing syncthing-linux-"$arch"
done done
env: env:

View File

@ -1,5 +1,4 @@
ARG GOVERSION=latest ARG GOVERSION=latest
ARG TARGETARCH
# #
# Maybe build Syncthing. This is a bit ugly as we can't make an entire # 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 FROM golang:$GOVERSION AS builder
ARG BUILD_USER ARG BUILD_USER
ARG BUILD_HOST ARG BUILD_HOST
ARG TARGETARCH
WORKDIR /src WORKDIR /src
COPY . . COPY . .
ENV CGO_ENABLED=0 ENV CGO_ENABLED=0
RUN echo syncthing-linux-$TARGETARCH
RUN if [ ! -f syncthing-linux-$TARGETARCH ] ; then \ RUN if [ ! -f syncthing-linux-$TARGETARCH ] ; then \
echo syncthing-linux-$TARGETARCH ; \
go run build.go -no-upgrade build syncthing ; \ 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 # 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 FROM alpine
ARG TARGETARCH
EXPOSE 8384 22000/tcp 22000/udp 21027/udp EXPOSE 8384 22000/tcp 22000/udp 21027/udp