forked from linuxserver/docker-syncthing
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile.aarch64
61 lines (52 loc) · 1.45 KB
/
Dockerfile.aarch64
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
FROM ghcr.io/linuxserver/baseimage-alpine:arm64v8-3.13 as buildstage
# build variables
ARG SYNCTHING_RELEASE
RUN \
echo "**** install build packages ****" && \
apk add --no-cache \
curl \
g++ \
gcc \
git \
go \
tar
RUN \
echo "**** fetch source code ****" && \
if [ -z ${SYNCTHING_RELEASE+x} ]; then \
SYNCTHING_RELEASE=$(curl -sX GET "https://api.github.com/repos/syncthing/syncthing/releases/latest" \
| awk '/tag_name/{print $4;exit}' FS='[""]'); \
fi && \
mkdir -p \
/tmp/sync && \
curl -o \
/tmp/syncthing-src.tar.gz -L \
"https://github.com/syncthing/syncthing/archive/${SYNCTHING_RELEASE}.tar.gz" && \
tar xf \
/tmp/syncthing-src.tar.gz -C \
/tmp/sync --strip-components=1 && \
echo "**** compile syncthing ****" && \
cd /tmp/sync && \
go clean -modcache && \
CGO_ENABLED=0 go run build.go \
-no-upgrade \
-version=${SYNCTHING_RELEASE} \
build syncthing
############## runtime stage ##############
FROM ghcr.io/linuxserver/baseimage-alpine:arm64v8-3.13
# set version label
ARG BUILD_DATE
ARG VERSION
LABEL build_version="Linuxserver.io version:- ${VERSION} Build-date:- ${BUILD_DATE}"
LABEL maintainer="thelamer"
# environment settings
ENV HOME="/config"
RUN \
echo "**** create var lib folder ****" && \
install -d -o abc -g abc \
/var/lib/syncthing
# copy files from build stage and local files
COPY --from=buildstage /tmp/sync/syncthing /usr/bin/
COPY root/ /
# ports and volumes
EXPOSE 8384 22000/tcp 22000/udp 21027/UDP
VOLUME /config