@@ -2,15 +2,14 @@ FROM lsiobase/alpine.arm64:3.9 as buildstage
22
33# build variables
44ARG SYNCTHING_RELEASE
5- ARG SYNC_SRC="/tmp/syncthing"
6- ARG SYNC_BUILD="$SYNC_SRC/src/github.com/syncthing/syncthing"
75
86RUN \
97 echo "**** install build packages ****" && \
108 apk add --no-cache \
119 curl \
1210 g++ \
1311 gcc \
12+ git \
1413 go \
1514 tar
1615
@@ -21,28 +20,19 @@ echo "**** fetch source code ****" && \
2120 | awk '/tag_name/{print $4;exit}' FS='[""]'); \
2221 fi && \
2322 mkdir -p \
24- "${SYNC_BUILD}" && \
23+ /tmp/sync && \
2524 curl -o \
2625 /tmp/syncthing-src.tar.gz -L \
2726 "https://github.com/syncthing/syncthing/archive/${SYNCTHING_RELEASE}.tar.gz" && \
2827 tar xf \
2928 /tmp/syncthing-src.tar.gz -C \
30- "${SYNC_BUILD}" --strip-components=1 && \
29+ /tmp/sync --strip-components=1 && \
3130 echo "**** compile syncthing ****" && \
32- cd "${SYNC_BUILD}" && \
33- export GOPATH="${SYNC_SRC}" && \
34- go run build.go -no-upgrade -version=${SYNCTHING_RELEASE} && \
35- echo "**** install syncthing to tmp folder ****" && \
36- mkdir -p \
37- /tmp/bin && \
38- install -D -m755 \
39- $SYNC_BUILD/bin/syncthing \
40- /tmp/bin/syncthing && \
41- for i in $(ls $SYNC_BUILD/bin); \
42- do if ! [ "$i" = "syncthing" ]; \
43- then install -Dm 755 $SYNC_BUILD/bin/$i /tmp/bin/$i ; \
44- fi; \
45- done
31+ cd /tmp/sync && \
32+ CGO_ENABLED=0 go run build.go \
33+ -no-upgrade \
34+ -version=${SYNCTHING_RELEASE} \
35+ build syncthing
4636
4737############## runtime stage ##############
4838FROM lsiobase/alpine.arm64:3.9
@@ -54,7 +44,7 @@ COPY qemu-aarch64-static /usr/bin
5444ARG BUILD_DATE
5545ARG VERSION
5646LABEL build_version="Linuxserver.io version:- ${VERSION} Build-date:- ${BUILD_DATE}"
57- LABEL maintainer="sparklyballs"
47+ LABEL maintainer="sparklyballs,thelamer "
5848
5949# environment settings
6050ENV HOME="/config"
6555 /var/lib/syncthing
6656
6757# copy files from build stage and local files
68- COPY --from=buildstage /tmp/bin/ /usr/bin/
58+ COPY --from=buildstage /tmp/sync/syncthing /usr/bin/
6959COPY root/ /
7060
7161# ports and volumes
0 commit comments