simplify build structure due to failing symlinks

This commit is contained in:
sparklyballs 2017-07-29 09:07:28 +01:00
parent d88bca8b16
commit ecf170307a
2 changed files with 15 additions and 18 deletions

View File

@ -7,11 +7,9 @@ ARG VERSION
LABEL build_version="Linuxserver.io version:- ${VERSION} Build-date:- ${BUILD_DATE}"
# environment settings
ENV HOME="/config"
# set build and source folders
ARG SYNC_SRC="/tmp/syncthing"
ARG SYNC_BUILD="$SYNC_SRC/src/github.com/syncthing"
ARG SYNC_BUILD="$SYNC_SRC/src/github.com/syncthing/syncthing"
ENV HOME="/config"
# install build packages
RUN \
@ -23,36 +21,34 @@ RUN \
tar && \
# compile syncthing
mkdir -p \
"${SYNC_BUILD}" && \
export GOPATH="${SYNC_SRC}" && \
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 \
/tmp/syncthing-src.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}" && \
/tmp/syncthing-src.tar.gz -C \
"${SYNC_BUILD}" --strip-components=1 && \
cd "${SYNC_BUILD}" && \
go run build.go -no-upgrade -version=${SYNC_TAG} && \
# install syncthing
# install syncthing
install -d -o abc -g abc \
/var/lib/syncthing && \
install -D -m755 \
$SYNC_BUILD/syncthing/bin/syncthing \
$SYNC_BUILD/bin/syncthing \
/usr/bin/syncthing && \
for i in $(ls $SYNC_BUILD/syncthing/bin); \
for i in $(ls $SYNC_BUILD/bin); \
do if ! [ "$i" = "syncthing" ]; \
then install -Dm 755 $SYNC_BUILD/syncthing/bin/$i /usr/bin/$i ; \
then install -Dm 755 $SYNC_BUILD/bin/$i /usr/bin/$i ; \
fi; \
done && \
export GOPATH="" && \
# cleanup
# cleanup
apk del --purge \
build-dependencies && \
rm -rf \

View File

@ -83,6 +83,7 @@ You can find some of the best documentation available on the web at [docs.syncth
## Versions
+ **29.07.17:** Simplify build structure as symlinks failing on > 0.14.32
+ **28.05.17:** Rebase to alpine 3.6.
+ **08.02.17:** Rebase to alpine 3.5.
+ **01.11.16:** Switch to compiling latest version from git source.