Skip to content

Commit 48047ab

Browse files
authored
Merge pull request #3 from linuxserver/dockerfile-updates
fixed broken echo lines and now using thelamer github release logic
2 parents f97a6ea + a98a300 commit 48047ab

File tree

7 files changed

+37
-24
lines changed

7 files changed

+37
-24
lines changed

Diff for: Dockerfile.aarch64

+10-5
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ COPY qemu-aarch64-static /usr/bin
77
# set version label
88
ARG BUILD_DATE
99
ARG VERSION
10+
ARG BOOKSTACK_RELEASE
1011
LABEL build_version="Linuxserver.io version:- ${VERSION} Build-date:- ${BUILD_DATE}"
1112
LABEL maintainer="homerr"
1213

@@ -26,6 +27,7 @@ apk add --no-cache \
2627
php7-mysqlnd \
2728
php7-tidy \
2829
php7-simplexml \
30+
php7-ctype \
2931
tar && \
3032

3133
echo "**** configure php-fpm to pass env vars ****" && \
@@ -36,14 +38,17 @@ echo "**** configure php-fpm to pass env vars ****" && \
3638

3739
echo "**** get bookstack ****" && \
3840

39-
BSAPP_VER="$(curl -sX GET https://api.github.com/repos/BookStackApp/BookStack/releases/latest | grep 'tag_name' | cut -d\" -f4)" && \
40-
4141
mkdir -p\
4242
/var/www/html && \
4343

44+
if [ -z ${BOOKSTACK_RELEASE+x} ]; then \
45+
BOOKSTACK_RELEASE=$(curl -sX GET "https://api.github.com/repos/bookstackapp/bookstack/releases/latest" \
46+
| awk '/tag_name/{print $4;exit}' FS='[""]'); \
47+
fi && \
48+
4449
curl -o \
45-
/tmp/bookstack.tar.gz -L \
46-
"https://github.com/BookStackApp/BookStack/archive/${BSAPP_VER}.tar.gz" && \
50+
/tmp/bookstack.tar.gz -L \
51+
"https://github.com/BookStackApp/BookStack/archive/${BOOKSTACK_RELEASE}.tar.gz" && \
4752

4853
tar xf \
4954
/tmp/bookstack.tar.gz -C \
@@ -57,7 +62,7 @@ cd /tmp && \
5762
curl -sS https://getcomposer.org/installer | php && \
5863
mv /tmp/composer.phar /usr/local/bin/composer && \
5964

60-
echo "**** run composer install ****"
65+
echo "**** run composer install ****" && \
6166

6267
composer install -d /var/www/html/ && \
6368

Diff for: Dockerfile.amd64

+10-7
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,10 @@
1-
# using ideas/code from other sparklyballs templates
2-
# set variable to get archive based on github api data (sparklyballs heimdall inspiration)
3-
1+
# using ideas/code from other thelamer & sparklyballs lsio templates
42
FROM lsiobase/alpine.nginx:3.7
53

64
# set version label
75
ARG BUILD_DATE
86
ARG VERSION
7+
ARG BOOKSTACK_RELEASE
98
LABEL build_version="Linuxserver.io version:- ${VERSION} Build-date:- ${BUILD_DATE}"
109
LABEL maintainer="homerr"
1110

@@ -25,6 +24,7 @@ apk add --no-cache \
2524
php7-mysqlnd \
2625
php7-tidy \
2726
php7-simplexml \
27+
php7-ctype \
2828
tar && \
2929

3030
echo "**** configure php-fpm to pass env vars ****" && \
@@ -35,14 +35,17 @@ echo "**** configure php-fpm to pass env vars ****" && \
3535

3636
echo "**** get bookstack ****" && \
3737

38-
BSAPP_VER="$(curl -sX GET https://api.github.com/repos/BookStackApp/BookStack/releases/latest | grep 'tag_name' | cut -d\" -f4)" && \
39-
4038
mkdir -p\
4139
/var/www/html && \
4240

41+
if [ -z ${BOOKSTACK_RELEASE+x} ]; then \
42+
BOOKSTACK_RELEASE=$(curl -sX GET "https://api.github.com/repos/bookstackapp/bookstack/releases/latest" \
43+
| awk '/tag_name/{print $4;exit}' FS='[""]'); \
44+
fi && \
45+
4346
curl -o \
4447
/tmp/bookstack.tar.gz -L \
45-
"https://github.com/BookStackApp/BookStack/archive/${BSAPP_VER}.tar.gz" && \
48+
"https://github.com/BookStackApp/BookStack/archive/${BOOKSTACK_RELEASE}.tar.gz" && \
4649

4750
tar xf \
4851
/tmp/bookstack.tar.gz -C \
@@ -56,7 +59,7 @@ cd /tmp && \
5659
curl -sS https://getcomposer.org/installer | php && \
5760
mv /tmp/composer.phar /usr/local/bin/composer && \
5861

59-
echo "**** run composer install ****"
62+
echo "**** run composer install ****" && \
6063

6164
composer install -d /var/www/html/ && \
6265

Diff for: Dockerfile.armhf

+10-5
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ COPY qemu-arm-static /usr/bin
77
# set version label
88
ARG BUILD_DATE
99
ARG VERSION
10+
ARG BOOKSTACK_RELEASE
1011
LABEL build_version="Linuxserver.io version:- ${VERSION} Build-date:- ${BUILD_DATE}"
1112
LABEL maintainer="homerr"
1213

@@ -26,6 +27,7 @@ apk add --no-cache \
2627
php7-mysqlnd \
2728
php7-tidy \
2829
php7-simplexml \
30+
php7-ctype \
2931
tar && \
3032

3133
echo "**** configure php-fpm to pass env vars ****" && \
@@ -36,14 +38,17 @@ echo "**** configure php-fpm to pass env vars ****" && \
3638

3739
echo "**** get bookstack ****" && \
3840

39-
BSAPP_VER="$(curl -sX GET https://api.github.com/repos/BookStackApp/BookStack/releases/latest | grep 'tag_name' | cut -d\" -f4)" && \
40-
4141
mkdir -p\
4242
/var/www/html && \
4343

44+
if [ -z ${BOOKSTACK_RELEASE+x} ]; then \
45+
BOOKSTACK_RELEASE=$(curl -sX GET "https://api.github.com/repos/bookstackapp/bookstack/releases/latest" \
46+
| awk '/tag_name/{print $4;exit}' FS='[""]'); \
47+
fi && \
48+
4449
curl -o \
45-
/tmp/bookstack.tar.gz -L \
46-
"https://github.com/BookStackApp/BookStack/archive/${BSAPP_VER}.tar.gz" && \
50+
/tmp/bookstack.tar.gz -L \
51+
"https://github.com/BookStackApp/BookStack/archive/${BOOKSTACK_RELEASE}.tar.gz" && \
4752

4853
tar xf \
4954
/tmp/bookstack.tar.gz -C \
@@ -57,7 +62,7 @@ cd /tmp && \
5762
curl -sS https://getcomposer.org/installer | php && \
5863
mv /tmp/composer.phar /usr/local/bin/composer && \
5964

60-
echo "**** run composer install ****"
65+
echo "**** run composer install ****" && \
6166

6267
composer install -d /var/www/html/ && \
6368

Diff for: Jenkinsfile

+6-6
Original file line numberDiff line numberDiff line change
@@ -495,8 +495,8 @@ pipeline {
495495
sh "docker manifest annotate ${DOCKERHUB_IMAGE}:${EXT_RELEASE}-ls${LS_TAG_NUMBER} ${DOCKERHUB_IMAGE}:arm32v6-${EXT_RELEASE}-ls${LS_TAG_NUMBER} --os linux --arch arm"
496496
sh "docker manifest annotate ${DOCKERHUB_IMAGE}:${EXT_RELEASE}-ls${LS_TAG_NUMBER} ${DOCKERHUB_IMAGE}:arm64v8-${EXT_RELEASE}-ls${LS_TAG_NUMBER} --os linux --arch arm64 --variant armv8"
497497
echo 'Pushing by manifest tags'
498-
sh "docker manifest push ${DOCKERHUB_IMAGE}:latest"
499-
sh "docker manifest push ${DOCKERHUB_IMAGE}:${EXT_RELEASE}-ls${LS_TAG_NUMBER}"
498+
sh "docker manifest push --purge ${DOCKERHUB_IMAGE}:latest"
499+
sh "docker manifest push --purge ${DOCKERHUB_IMAGE}:${EXT_RELEASE}-ls${LS_TAG_NUMBER}"
500500
}
501501
}
502502
}
@@ -717,8 +717,8 @@ pipeline {
717717
sh "docker manifest annotate ${DEV_DOCKERHUB_IMAGE}:${EXT_RELEASE}-pkg-${PACKAGE_TAG}-dev-${COMMIT_SHA} ${DEV_DOCKERHUB_IMAGE}:arm32v6-${EXT_RELEASE}-pkg-${PACKAGE_TAG}-dev-${COMMIT_SHA} --os linux --arch arm"
718718
sh "docker manifest annotate ${DEV_DOCKERHUB_IMAGE}:${EXT_RELEASE}-pkg-${PACKAGE_TAG}-dev-${COMMIT_SHA} ${DEV_DOCKERHUB_IMAGE}:arm64v8-${EXT_RELEASE}-pkg-${PACKAGE_TAG}-dev-${COMMIT_SHA} --os linux --arch arm64 --variant armv8"
719719
echo 'Pushing by manifest tags'
720-
sh "docker manifest push ${DEV_DOCKERHUB_IMAGE}:latest"
721-
sh "docker manifest push ${DEV_DOCKERHUB_IMAGE}:${EXT_RELEASE}-pkg-${PACKAGE_TAG}-dev-${COMMIT_SHA}"
720+
sh "docker manifest push --purge ${DEV_DOCKERHUB_IMAGE}:latest"
721+
sh "docker manifest push --purge ${DEV_DOCKERHUB_IMAGE}:${EXT_RELEASE}-pkg-${PACKAGE_TAG}-dev-${COMMIT_SHA}"
722722
}
723723
script{
724724
env.DOCKERHUB_LINK = sh(
@@ -815,8 +815,8 @@ pipeline {
815815
sh "docker manifest annotate ${PR_DOCKERHUB_IMAGE}:${EXT_RELEASE}-pkg-${PACKAGE_TAG}-pr-${PULL_REQUEST} ${PR_DOCKERHUB_IMAGE}:arm32v6-${EXT_RELEASE}-pkg-${PACKAGE_TAG}-pr-${PULL_REQUEST} --os linux --arch arm"
816816
sh "docker manifest annotate ${PR_DOCKERHUB_IMAGE}:${EXT_RELEASE}-pkg-${PACKAGE_TAG}-pr-${PULL_REQUEST} ${PR_DOCKERHUB_IMAGE}:arm64v8-${EXT_RELEASE}-pkg-${PACKAGE_TAG}-pr-${PULL_REQUEST} --os linux --arch arm64 --variant armv8"
817817
echo 'Pushing by manifest tags'
818-
sh "docker manifest push ${PR_DOCKERHUB_IMAGE}:latest"
819-
sh "docker manifest push ${PR_DOCKERHUB_IMAGE}:${EXT_RELEASE}-pkg-${PACKAGE_TAG}-pr-${PULL_REQUEST}"
818+
sh "docker manifest push --purge ${PR_DOCKERHUB_IMAGE}:latest"
819+
sh "docker manifest push --purge ${PR_DOCKERHUB_IMAGE}:${EXT_RELEASE}-pkg-${PACKAGE_TAG}-pr-${PULL_REQUEST}"
820820
}
821821
script{
822822
env.CODE_URL = sh(

Diff for: qemu-aarch64-static

100644100755
File mode changed.

Diff for: qemu-arm-static

100644100755
File mode changed.

Diff for: root/etc/cont-init.d/50-config

+1-1
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ sed -i "s/DB_HOST=localhost/DB_HOST=${DB_HOST}/g" /var/www/html/.env
3434

3535
sed -i "s/DB_DATABASE=database_database/DB_DATABASE=${DB_DATABASE}/g" /var/www/html/.env
3636

37-
sed -i "s/DB_USERNAME=database_username/DB_USER=${DB_USER}/g" /var/www/html/.env
37+
sed -i "s/DB_USERNAME=database_username/DB_USERNAME=${DB_USER}/g" /var/www/html/.env
3838

3939
sed -i "s/DB_PASSWORD=database_user_password/DB_PASSWORD=${DB_PASS}/g" /var/www/html/.env
4040

0 commit comments

Comments
 (0)