Merge pull request #10 from linuxserver/compiled

compile syncthing from github source
This commit is contained in:
aptalca 2016-11-02 12:54:19 -04:00 committed by GitHub
commit 91631cbc34
2 changed files with 54 additions and 8 deletions

View File

@ -6,17 +6,62 @@ ARG BUILD_DATE
ARG VERSION
LABEL build_version="Linuxserver.io version:- ${VERSION} Build-date:- ${BUILD_DATE}"
# environment settings
# environment settings
ENV HOME="/config"
# install packages
RUN \
apk add --no-cache \
--repository http://nl.alpinelinux.org/alpine/edge/community \
syncthing \
syncthing-utils
# set build and source folders
ARG SYNC_SRC="/tmp/syncthing"
ARG SYNC_BUILD="$SYNC_SRC/src/github.com/syncthing"
# add local files
# install build packages
RUN \
apk add --no-cache --virtual=build-dependencies \
curl \
g++ \
gcc \
tar && \
apk add --no-cache --virtual=build-dependencies2 \
--repository http://nl.alpinelinux.org/alpine/edge/community \
go && \
# compile syncthing
SYNC_TAG=$(curl -sX GET "https://api.github.com/repos/syncthing/syncthing/releases/latest" \
| awk '/tag_name/{print $4;exit}' FS='[""]') && \
mkdir -p \
"${SYNC_BUILD}" \
"${SYNC_SRC}" && \
curl -o \
/tmp/syncthing.tar.gz -L \
"https://github.com/syncthing/syncthing/archive/${SYNC_TAG}.tar.gz" && \
tar xf \
/tmp/syncthing.tar.gz -C \
"${SYNC_SRC}" --strip-components=1 && \
ln -s "$SYNC_SRC" "$SYNC_BUILD/syncthing" && \
cd "$SYNC_BUILD"/syncthing && \
export GOPATH="${SYNC_SRC}" && \
go run build.go -no-upgrade -version=${SYNC_TAG} && \
# install syncthing
install -d -o abc -g abc \
/var/lib/syncthing && \
install -D -m755 \
$SYNC_BUILD/syncthing/bin/syncthing \
/usr/bin/syncthing && \
for i in $(ls $SYNC_BUILD/syncthing/bin); \
do if ! [ "$i" = "syncthing" ]; \
then install -Dm 755 $SYNC_BUILD/syncthing/bin/$i /usr/bin/$i ; \
fi; \
done && \
export GOPATH="" && \
# cleanup
apk del --purge \
build-dependencies \
build-dependencies2 && \
rm -rf \
/tmp/*
# add local files
COPY root/ /
# ports and volumes

View File

@ -83,6 +83,7 @@ You can find some of the best documentation available on the web at [docs.syncth
## Versions
+ **01.11.16:** Switch to compiling latest version from git source.
+ **14.10.16:** Add version layer information.
+ **30.09.16:** Fix umask.
+ **09.09.16:** Add layer badges to README.