From 63a4fcaacc810ffdd0b34e962054af93f407f0dc Mon Sep 17 00:00:00 2001 From: chbmb Date: Sun, 2 Jun 2019 15:42:37 +0100 Subject: [PATCH 1/5] Change to release based tagging Rebase on Ubuntu baseimage. --- Dockerfile | 64 +++++++++----------------------- Dockerfile.aarch64 | 66 ++++++++++----------------------- Dockerfile.armhf | 68 +++++++++++----------------------- root/etc/cont-init.d/30-config | 8 ++++ 4 files changed, 66 insertions(+), 140 deletions(-) diff --git a/Dockerfile b/Dockerfile index 63c4e41..0087b0a 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,60 +1,32 @@ -FROM lsiobase/python:3.9 +FROM lsiobase/ubuntu:bionic # set version label ARG BUILD_DATE ARG VERSION -ARG CALIBRE_COMMIT +ARG CALIBRE_RELEASE LABEL build_version="Linuxserver.io version:- ${VERSION} Build-date:- ${BUILD_DATE}" LABEL maintainer="chbmb" RUN \ echo "**** install build packages ****" && \ - apk add --no-cache --virtual=build-dependencies \ - file \ - fontconfig-dev \ - freetype-dev \ - g++ \ - gcc \ - ghostscript-dev \ - lcms2-dev \ - libjpeg-turbo-dev \ - libpng-dev \ - libtool \ - libwebp-dev \ - libxml2-dev \ - libxslt-dev \ - make \ - perl-dev \ - python2-dev \ - tiff-dev \ - xz \ - zlib-dev && \ + apt-get update && \ + apt-get install -y \ + git \ + python-pip && \ echo "**** install runtime packages ****" && \ - apk add --no-cache \ - fontconfig \ - freetype \ - ghostscript \ - imagemagick6 \ - jq \ - lcms2 \ - libjpeg-turbo \ - libltdl \ - libpng \ - libwebp \ - libxml2 \ - libxslt \ - tiff \ - zlib && \ + apt-get install -y \ + imagemagick \ + python-minimal && \ echo "**** install calibre-web ****" && \ - if [ -z ${CALIBRE_COMMIT+x} ]; then \ - CALIBRE_COMMIT=$(curl -sX GET https://api.github.com/repos/janeczku/calibre-web/commits/master \ - | jq -r '. | .sha'); \ - fi && \ + if [ -z ${CALIBRE_RELEASE+x} ]; then \ + CALIBRE_RELEASE=$(curl -sX GET "https://api.github.com/repos/janeczku/calibre-web/releases/latest" \ + | awk '/tag_name/{print $4;exit}' FS='[""]'); \ + fi && \ + curl -o \ + /tmp/calibre-web.tar.gz -L \ + https://github.com/janeczku/calibre-web/archive/${CALIBRE_RELEASE}.tar.gz && \ mkdir -p \ /app/calibre-web && \ - curl -o \ - /tmp/calibre-web.tar.gz -L \ - https://github.com/janeczku/calibre-web/archive/${CALIBRE_COMMIT}.tar.gz && \ tar xf \ /tmp/calibre-web.tar.gz -C \ /app/calibre-web --strip-components=1 && \ @@ -64,11 +36,9 @@ RUN \ pip install --no-cache-dir -U -r \ optional-requirements.txt && \ echo "**** cleanup ****" && \ - apk del --purge \ - build-dependencies && \ rm -rf \ /tmp/* - + # add local files COPY root/ / diff --git a/Dockerfile.aarch64 b/Dockerfile.aarch64 index e30448f..e6e466b 100644 --- a/Dockerfile.aarch64 +++ b/Dockerfile.aarch64 @@ -1,60 +1,32 @@ -FROM lsiobase/python:arm64v8-3.9 +FROM lsiobase/ubuntu:arm64v8-bionic # set version label ARG BUILD_DATE ARG VERSION -ARG CALIBRE_COMMIT +ARG CALIBRE_RELEASE LABEL build_version="Linuxserver.io version:- ${VERSION} Build-date:- ${BUILD_DATE}" LABEL maintainer="chbmb" RUN \ echo "**** install build packages ****" && \ - apk add --no-cache --virtual=build-dependencies \ - file \ - fontconfig-dev \ - freetype-dev \ - g++ \ - gcc \ - ghostscript-dev \ - lcms2-dev \ - libjpeg-turbo-dev \ - libpng-dev \ - libtool \ - libwebp-dev \ - libxml2-dev \ - libxslt-dev \ - make \ - perl-dev \ - python2-dev \ - tiff-dev \ - xz \ - zlib-dev && \ + apt-get update && \ + apt-get install -y \ + git \ + python-pip && \ echo "**** install runtime packages ****" && \ - apk add --no-cache \ - fontconfig \ - freetype \ - ghostscript \ - imagemagick6 \ - jq \ - lcms2 \ - libjpeg-turbo \ - libltdl \ - libpng \ - libwebp \ - libxml2 \ - libxslt \ - tiff \ - zlib && \ + apt-get install -y \ + imagemagick \ + python-minimal && \ echo "**** install calibre-web ****" && \ - if [ -z ${CALIBRE_COMMIT+x} ]; then \ - CALIBRE_COMMIT=$(curl -sX GET https://api.github.com/repos/janeczku/calibre-web/commits/master \ - | jq -r '. | .sha'); \ - fi && \ + if [ -z ${CALIBRE_RELEASE+x} ]; then \ + CALIBRE_RELEASE=$(curl -sX GET "https://api.github.com/repos/janeczku/calibre-web/releases/latest" \ + | awk '/tag_name/{print $4;exit}' FS='[""]'); \ + fi && \ + curl -o \ + /tmp/calibre-web.tar.gz -L \ + https://github.com/janeczku/calibre-web/archive/${CALIBRE_RELEASE}.tar.gz && \ mkdir -p \ /app/calibre-web && \ - curl -o \ - /tmp/calibre-web.tar.gz -L \ - https://github.com/janeczku/calibre-web/archive/${CALIBRE_COMMIT}.tar.gz && \ tar xf \ /tmp/calibre-web.tar.gz -C \ /app/calibre-web --strip-components=1 && \ @@ -64,8 +36,10 @@ RUN \ pip install --no-cache-dir -U -r \ optional-requirements.txt && \ echo "**** cleanup ****" && \ - apk del --purge \ - build-dependencies && \ + apt-get -y remove \ + git \ + python-pip && \ + apt-get -y autoremove && \ rm -rf \ /tmp/* diff --git a/Dockerfile.armhf b/Dockerfile.armhf index d5e6764..4dafbca 100644 --- a/Dockerfile.armhf +++ b/Dockerfile.armhf @@ -1,60 +1,32 @@ -FROM lsiobase/python:arm32v7-3.9 +FROM lsiobase/ubuntu:arm32v7-bionic # set version label ARG BUILD_DATE ARG VERSION -ARG CALIBRE_COMMIT +ARG CALIBRE_RELEASE LABEL build_version="Linuxserver.io version:- ${VERSION} Build-date:- ${BUILD_DATE}" LABEL maintainer="chbmb" RUN \ echo "**** install build packages ****" && \ - apk add --no-cache --virtual=build-dependencies \ - file \ - fontconfig-dev \ - freetype-dev \ - g++ \ - gcc \ - ghostscript-dev \ - lcms2-dev \ - libjpeg-turbo-dev \ - libpng-dev \ - libtool \ - libwebp-dev \ - libxml2-dev \ - libxslt-dev \ - make \ - perl-dev \ - python2-dev \ - tiff-dev \ - xz \ - zlib-dev && \ + apt-get update && \ + apt-get install -y \ + git \ + python-pip && \ echo "**** install runtime packages ****" && \ - apk add --no-cache \ - fontconfig \ - freetype \ - ghostscript \ - imagemagick6 \ - jq \ - lcms2 \ - libjpeg-turbo \ - libltdl \ - libpng \ - libwebp \ - libxml2 \ - libxslt \ - tiff \ - zlib && \ + apt-get install -y \ + imagemagick \ + python-minimal && \ echo "**** install calibre-web ****" && \ - if [ -z ${CALIBRE_COMMIT+x} ]; then \ - CALIBRE_COMMIT=$(curl -sX GET https://api.github.com/repos/janeczku/calibre-web/commits/master \ - | jq -r '. | .sha'); \ - fi && \ + if [ -z ${CALIBRE_RELEASE+x} ]; then \ + CALIBRE_RELEASE=$(curl -sX GET "https://api.github.com/repos/janeczku/calibre-web/releases/latest" \ + | awk '/tag_name/{print $4;exit}' FS='[""]'); \ + fi && \ + curl -o \ + /tmp/calibre-web.tar.gz -L \ + https://github.com/janeczku/calibre-web/archive/${CALIBRE_RELEASE}.tar.gz && \ mkdir -p \ /app/calibre-web && \ - curl -o \ - /tmp/calibre-web.tar.gz -L \ - https://github.com/janeczku/calibre-web/archive/${CALIBRE_COMMIT}.tar.gz && \ tar xf \ /tmp/calibre-web.tar.gz -C \ /app/calibre-web --strip-components=1 && \ @@ -64,8 +36,10 @@ RUN \ pip install --no-cache-dir -U -r \ optional-requirements.txt && \ echo "**** cleanup ****" && \ - apk del --purge \ - build-dependencies && \ + apt-get -y remove \ + git \ + python-pip && \ + apt-get -y autoremove && \ rm -rf \ /tmp/* @@ -74,4 +48,4 @@ COPY root/ / # ports and volumes EXPOSE 8083 -VOLUME /books /config +VOLUME /books /config \ No newline at end of file diff --git a/root/etc/cont-init.d/30-config b/root/etc/cont-init.d/30-config index d227b8a..24fa15e 100644 --- a/root/etc/cont-init.d/30-config +++ b/root/etc/cont-init.d/30-config @@ -8,6 +8,7 @@ [[ ! -L /app/calibre-web/app.db ]] && \ ln -s /config/app.db /app/calibre-web/app.db +# create symlinks for log [[ ! -f /config/calibre-web.log ]] && \ touch /config/calibre-web.log [[ -f /app/calibre-web/calibre-web.log ]] && \ @@ -15,6 +16,13 @@ [[ ! -L /app/calibre-web/calibre-web.log ]] && \ ln -s /config/calibre-web.log /app/calibre-web/calibre-web.log +# Google Drive Integration +[[ ! -f /config/client_secrets.json ]] && \ + echo "{}" > /config/client_secrets.json +[[ -f /app/calibre-web/client_secrets.json ]] && + rm /app/calibre-web/client_secrets.json +[[ ! -L /app/calibre-web/client_secrets.json ]] && + ln -s /config/client_secrets.json /app/calibre-web/client_secrets.json # permissions chown -R abc:abc \ From 1cb1f09abcd0ee1773732aa273a4f91174d588b6 Mon Sep 17 00:00:00 2001 From: chbmb Date: Sun, 2 Jun 2019 15:55:03 +0100 Subject: [PATCH 2/5] Gdrive fix --- root/etc/cont-init.d/30-config | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/root/etc/cont-init.d/30-config b/root/etc/cont-init.d/30-config index 24fa15e..e5081a3 100644 --- a/root/etc/cont-init.d/30-config +++ b/root/etc/cont-init.d/30-config @@ -16,7 +16,7 @@ [[ ! -L /app/calibre-web/calibre-web.log ]] && \ ln -s /config/calibre-web.log /app/calibre-web/calibre-web.log -# Google Drive Integration +# create Google drive client_secrets.json file [[ ! -f /config/client_secrets.json ]] && \ echo "{}" > /config/client_secrets.json [[ -f /app/calibre-web/client_secrets.json ]] && @@ -24,6 +24,14 @@ [[ ! -L /app/calibre-web/client_secrets.json ]] && ln -s /config/client_secrets.json /app/calibre-web/client_secrets.json +# create Google drive symlinks for database +[[ ! -f /config/gdrive.db ]] && \ + cp /app/calibre-web/gdrive.db /config/gdrive.db +[[ -f /app/calibre-web/gdrive.db ]] && \ + rm /app/calibre-web/gdrive.db +[[ ! -L /app/calibre-web/gdrive.db ]] && \ + ln -s /config/gdrive.db /app/calibre-web/gdrive.db + # permissions chown -R abc:abc \ /config \ From d58aaabd4d53d0e96683c42935fc8a38e6c9667b Mon Sep 17 00:00:00 2001 From: chbmb Date: Sun, 2 Jun 2019 16:03:09 +0100 Subject: [PATCH 3/5] Update release variable, readme & jenkins --- Dockerfile | 8 ++++---- Dockerfile.aarch64 | 8 ++++---- Dockerfile.armhf | 8 ++++---- Jenkinsfile | 18 +++++++++--------- README.md | 1 + jenkins-vars.yml | 6 +++--- readme-vars.yml | 1 + 7 files changed, 26 insertions(+), 24 deletions(-) diff --git a/Dockerfile b/Dockerfile index 0087b0a..7495412 100644 --- a/Dockerfile +++ b/Dockerfile @@ -3,7 +3,7 @@ FROM lsiobase/ubuntu:bionic # set version label ARG BUILD_DATE ARG VERSION -ARG CALIBRE_RELEASE +ARG CALIBREWEB_RELEASE LABEL build_version="Linuxserver.io version:- ${VERSION} Build-date:- ${BUILD_DATE}" LABEL maintainer="chbmb" @@ -18,13 +18,13 @@ RUN \ imagemagick \ python-minimal && \ echo "**** install calibre-web ****" && \ - if [ -z ${CALIBRE_RELEASE+x} ]; then \ - CALIBRE_RELEASE=$(curl -sX GET "https://api.github.com/repos/janeczku/calibre-web/releases/latest" \ + if [ -z ${CALIBREWEB_RELEASE+x} ]; then \ + CALIBREWEB_RELEASE=$(curl -sX GET "https://api.github.com/repos/janeczku/calibre-web/releases/latest" \ | awk '/tag_name/{print $4;exit}' FS='[""]'); \ fi && \ curl -o \ /tmp/calibre-web.tar.gz -L \ - https://github.com/janeczku/calibre-web/archive/${CALIBRE_RELEASE}.tar.gz && \ + https://github.com/janeczku/calibre-web/archive/${CALIBREWEB_RELEASE}.tar.gz && \ mkdir -p \ /app/calibre-web && \ tar xf \ diff --git a/Dockerfile.aarch64 b/Dockerfile.aarch64 index e6e466b..f4870ff 100644 --- a/Dockerfile.aarch64 +++ b/Dockerfile.aarch64 @@ -3,7 +3,7 @@ FROM lsiobase/ubuntu:arm64v8-bionic # set version label ARG BUILD_DATE ARG VERSION -ARG CALIBRE_RELEASE +ARG CALIBREWEB_RELEASE LABEL build_version="Linuxserver.io version:- ${VERSION} Build-date:- ${BUILD_DATE}" LABEL maintainer="chbmb" @@ -18,13 +18,13 @@ RUN \ imagemagick \ python-minimal && \ echo "**** install calibre-web ****" && \ - if [ -z ${CALIBRE_RELEASE+x} ]; then \ - CALIBRE_RELEASE=$(curl -sX GET "https://api.github.com/repos/janeczku/calibre-web/releases/latest" \ + if [ -z ${CALIBREWEB_RELEASE+x} ]; then \ + CALIBREWEB_RELEASE=$(curl -sX GET "https://api.github.com/repos/janeczku/calibre-web/releases/latest" \ | awk '/tag_name/{print $4;exit}' FS='[""]'); \ fi && \ curl -o \ /tmp/calibre-web.tar.gz -L \ - https://github.com/janeczku/calibre-web/archive/${CALIBRE_RELEASE}.tar.gz && \ + https://github.com/janeczku/calibre-web/archive/${CALIBREWEB_RELEASE}.tar.gz && \ mkdir -p \ /app/calibre-web && \ tar xf \ diff --git a/Dockerfile.armhf b/Dockerfile.armhf index 4dafbca..d84dfa3 100644 --- a/Dockerfile.armhf +++ b/Dockerfile.armhf @@ -3,7 +3,7 @@ FROM lsiobase/ubuntu:arm32v7-bionic # set version label ARG BUILD_DATE ARG VERSION -ARG CALIBRE_RELEASE +ARG CALIBREWEB_RELEASE LABEL build_version="Linuxserver.io version:- ${VERSION} Build-date:- ${BUILD_DATE}" LABEL maintainer="chbmb" @@ -18,13 +18,13 @@ RUN \ imagemagick \ python-minimal && \ echo "**** install calibre-web ****" && \ - if [ -z ${CALIBRE_RELEASE+x} ]; then \ - CALIBRE_RELEASE=$(curl -sX GET "https://api.github.com/repos/janeczku/calibre-web/releases/latest" \ + if [ -z ${CALIBREWEB_RELEASE+x} ]; then \ + CALIBREWEB_RELEASE=$(curl -sX GET "https://api.github.com/repos/janeczku/calibre-web/releases/latest" \ | awk '/tag_name/{print $4;exit}' FS='[""]'); \ fi && \ curl -o \ /tmp/calibre-web.tar.gz -L \ - https://github.com/janeczku/calibre-web/archive/${CALIBRE_RELEASE}.tar.gz && \ + https://github.com/janeczku/calibre-web/archive/${CALIBREWEB_RELEASE}.tar.gz && \ mkdir -p \ /app/calibre-web && \ tar xf \ diff --git a/Jenkinsfile b/Jenkinsfile index 4f993f8..7bc6d9e 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -13,14 +13,14 @@ pipeline { EXT_GIT_BRANCH = 'master' EXT_USER = 'janeczku' EXT_REPO = 'calibre-web' - BUILD_VERSION_ARG = 'CALIBRE_COMMIT' + BUILD_VERSION_ARG = 'CALIBREWEB_RELEASE' LS_USER = 'linuxserver' LS_REPO = 'docker-calibre-web' CONTAINER_NAME = 'calibre-web' DOCKERHUB_IMAGE = 'linuxserver/calibre-web' DEV_DOCKERHUB_IMAGE = 'lsiodev/calibre-web' PR_DOCKERHUB_IMAGE = 'lspipepr/calibre-web' - DIST_IMAGE = 'alpine' + DIST_IMAGE = 'ubuntu' MULTIARCH='true' CI='true' CI_WEB='true' @@ -102,21 +102,21 @@ pipeline { /* ######################## External Release Tagging ######################## */ - // If this is a github commit trigger determine the current commit at head - stage("Set ENV github_commit"){ + // If this is a stable github release use the latest endpoint from github to determine the ext tag + stage("Set ENV github_stable"){ steps{ script{ env.EXT_RELEASE = sh( - script: '''curl -s https://api.github.com/repos/${EXT_USER}/${EXT_REPO}/commits/${EXT_GIT_BRANCH} | jq -r '. | .sha' | cut -c1-8 ''', + script: '''curl -s https://api.github.com/repos/${EXT_USER}/${EXT_REPO}/releases/latest | jq -r '. | .tag_name' ''', returnStdout: true).trim() } } } - // If this is a github commit trigger Set the external release link - stage("Set ENV commit_link"){ + // If this is a stable or devel github release generate the link for the build message + stage("Set ENV github_link"){ steps{ script{ - env.RELEASE_LINK = 'https://github.com/' + env.EXT_USER + '/' + env.EXT_REPO + '/commit/' + env.EXT_RELEASE + env.RELEASE_LINK = 'https://github.com/' + env.EXT_USER + '/' + env.EXT_REPO + '/releases/tag/' + env.EXT_RELEASE } } } @@ -604,7 +604,7 @@ pipeline { "tagger": {"name": "LinuxServer Jenkins","email": "jenkins@linuxserver.io","date": "'${GITHUB_DATE}'"}}' ''' echo "Pushing New release for Tag" sh '''#! /bin/bash - curl -s https://api.github.com/repos/${EXT_USER}/${EXT_REPO}/commits/${EXT_GIT_BRANCH} | jq '. | .commit.message' | sed 's:^.\\(.*\\).$:\\1:' > releasebody.json + curl -s https://api.github.com/repos/${EXT_USER}/${EXT_REPO}/releases/latest | jq '. |.body' | sed 's:^.\\(.*\\).$:\\1:' > releasebody.json echo '{"tag_name":"'${EXT_RELEASE_CLEAN}'-ls'${LS_TAG_NUMBER}'",\ "target_commitish": "master",\ "name": "'${EXT_RELEASE_CLEAN}'-ls'${LS_TAG_NUMBER}'",\ diff --git a/README.md b/README.md index c9f0517..eadf91f 100644 --- a/README.md +++ b/README.md @@ -199,6 +199,7 @@ Once registered you can define the dockerfile to use with `-f Dockerfile.aarch64 ## Versions +* **02.06.19:** - Rebase to Ubuntu Bionic & add Gdrive support. * **23.03.19:** - Switching to new Base images, shift to arm32v7 tag. * **23.02.19:** - Rebase to alpine 3.9, use repo version of imagemagick. * **11.02.19:** - Add pipeline logic and multi arch. diff --git a/jenkins-vars.yml b/jenkins-vars.yml index 5271e2c..f31a209 100644 --- a/jenkins-vars.yml +++ b/jenkins-vars.yml @@ -2,7 +2,7 @@ # jenkins variables project_name: docker-calibre-web -external_type: github_commit +external_type: github_stable release_type: stable release_tag: latest ls_branch: master @@ -10,14 +10,14 @@ repo_vars: - EXT_GIT_BRANCH = 'master' - EXT_USER = 'janeczku' - EXT_REPO = 'calibre-web' - - BUILD_VERSION_ARG = 'CALIBRE_COMMIT' + - BUILD_VERSION_ARG = 'CALIBREWEB_RELEASE' - LS_USER = 'linuxserver' - LS_REPO = 'docker-calibre-web' - CONTAINER_NAME = 'calibre-web' - DOCKERHUB_IMAGE = 'linuxserver/calibre-web' - DEV_DOCKERHUB_IMAGE = 'lsiodev/calibre-web' - PR_DOCKERHUB_IMAGE = 'lspipepr/calibre-web' - - DIST_IMAGE = 'alpine' + - DIST_IMAGE = 'ubuntu' - MULTIARCH='true' - CI='true' - CI_WEB='true' diff --git a/readme-vars.yml b/readme-vars.yml index 2989580..493cc2b 100644 --- a/readme-vars.yml +++ b/readme-vars.yml @@ -69,6 +69,7 @@ app_setup_block: | # changelog changelogs: + - { date: "02.06.19:", desc: "Rebase to Ubuntu Bionic & add Gdrive support." } - { date: "23.03.19:", desc: "Switching to new Base images, shift to arm32v7 tag." } - { date: "23.02.19:", desc: "Rebase to alpine 3.9, use repo version of imagemagick." } - { date: "11.02.19:", desc: "Add pipeline logic and multi arch." } From a9ae6f095c5fae6aabaab33fbe7822364e25662e Mon Sep 17 00:00:00 2001 From: chbmb Date: Mon, 3 Jun 2019 00:13:31 +0100 Subject: [PATCH 4/5] Fix armhf & aarch --- Dockerfile | 4 ++++ Dockerfile.aarch64 | 20 +++++++++++++++++--- Dockerfile.armhf | 28 +++++++++++++++++++--------- 3 files changed, 40 insertions(+), 12 deletions(-) diff --git a/Dockerfile b/Dockerfile index 7495412..c59f597 100644 --- a/Dockerfile +++ b/Dockerfile @@ -36,6 +36,10 @@ RUN \ pip install --no-cache-dir -U -r \ optional-requirements.txt && \ echo "**** cleanup ****" && \ + apt-get -y remove \ + git \ + python-pip && \ + apt-get -y autoremove && \ rm -rf \ /tmp/* diff --git a/Dockerfile.aarch64 b/Dockerfile.aarch64 index f4870ff..2785b24 100644 --- a/Dockerfile.aarch64 +++ b/Dockerfile.aarch64 @@ -11,8 +11,15 @@ RUN \ echo "**** install build packages ****" && \ apt-get update && \ apt-get install -y \ + g++ \ + gcc \ git \ - python-pip && \ + libffi-dev \ + libjpeg-dev \ + libxml2-dev \ + libxslt1-dev \ + python-pip \ + zlib1g-dev && \ echo "**** install runtime packages ****" && \ apt-get install -y \ imagemagick \ @@ -37,8 +44,15 @@ RUN \ optional-requirements.txt && \ echo "**** cleanup ****" && \ apt-get -y remove \ - git \ - python-pip && \ + g++ \ + gcc \ + git \ + libffi-dev \ + libjpeg-dev \ + libxml2-dev \ + libxslt1-dev \ + python-pip \ + zlib1g-dev && \ apt-get -y autoremove && \ rm -rf \ /tmp/* diff --git a/Dockerfile.armhf b/Dockerfile.armhf index d84dfa3..d947a2a 100644 --- a/Dockerfile.armhf +++ b/Dockerfile.armhf @@ -11,8 +11,15 @@ RUN \ echo "**** install build packages ****" && \ apt-get update && \ apt-get install -y \ + g++ \ + gcc \ git \ - python-pip && \ + libffi-dev \ + libjpeg-dev \ + libxml2-dev \ + libxslt1-dev \ + python-pip \ + zlib1g-dev && \ echo "**** install runtime packages ****" && \ apt-get install -y \ imagemagick \ @@ -37,15 +44,18 @@ RUN \ optional-requirements.txt && \ echo "**** cleanup ****" && \ apt-get -y remove \ - git \ - python-pip && \ - apt-get -y autoremove && \ + g++ \ + gcc \ + git \ + libffi-dev \ + libjpeg-dev \ + libxml2-dev \ + libxslt1-dev \ + python-pip \ + zlib1g-dev && \ + apt-get -y autoremove && \ rm -rf \ /tmp/* # add local files -COPY root/ / - -# ports and volumes -EXPOSE 8083 -VOLUME /books /config \ No newline at end of file +COPY root/ / \ No newline at end of file From 823ae24b8494554fa09d8d19b6af8f94ade10af7 Mon Sep 17 00:00:00 2001 From: thelamer Date: Tue, 4 Jun 2019 20:48:24 -0700 Subject: [PATCH 5/5] cleanup changes and formatting --- Dockerfile | 38 +++++++++--------- Dockerfile.aarch64 | 66 ++++++++++++++++--------------- Dockerfile.armhf | 72 ++++++++++++++++++---------------- Jenkinsfile | 1 + readme-vars.yml | 7 ---- root/etc/cont-init.d/30-config | 6 +-- 6 files changed, 97 insertions(+), 93 deletions(-) diff --git a/Dockerfile b/Dockerfile index c59f597..bae7ed6 100644 --- a/Dockerfile +++ b/Dockerfile @@ -9,21 +9,21 @@ LABEL maintainer="chbmb" RUN \ echo "**** install build packages ****" && \ - apt-get update && \ - apt-get install -y \ - git \ - python-pip && \ + apt-get update && \ + apt-get install -y \ + git \ + python-pip && \ echo "**** install runtime packages ****" && \ - apt-get install -y \ - imagemagick \ - python-minimal && \ + apt-get install -y \ + imagemagick \ + python-minimal && \ echo "**** install calibre-web ****" && \ - if [ -z ${CALIBREWEB_RELEASE+x} ]; then \ - CALIBREWEB_RELEASE=$(curl -sX GET "https://api.github.com/repos/janeczku/calibre-web/releases/latest" \ - | awk '/tag_name/{print $4;exit}' FS='[""]'); \ - fi && \ - curl -o \ - /tmp/calibre-web.tar.gz -L \ + if [ -z ${CALIBREWEB_RELEASE+x} ]; then \ + CALIBREWEB_RELEASE=$(curl -sX GET "https://api.github.com/repos/janeczku/calibre-web/releases/latest" \ + | awk '/tag_name/{print $4;exit}' FS='[""]'); \ + fi && \ + curl -o \ + /tmp/calibre-web.tar.gz -L \ https://github.com/janeczku/calibre-web/archive/${CALIBREWEB_RELEASE}.tar.gz && \ mkdir -p \ /app/calibre-web && \ @@ -36,12 +36,14 @@ RUN \ pip install --no-cache-dir -U -r \ optional-requirements.txt && \ echo "**** cleanup ****" && \ - apt-get -y remove \ - git \ - python-pip && \ - apt-get -y autoremove && \ + apt-get -y purge \ + git \ + python-pip && \ + apt-get -y autoremove && \ rm -rf \ - /tmp/* + /tmp/* \ + /var/lib/apt/lists/* \ + /var/tmp/* # add local files COPY root/ / diff --git a/Dockerfile.aarch64 b/Dockerfile.aarch64 index 2785b24..2eae7bb 100644 --- a/Dockerfile.aarch64 +++ b/Dockerfile.aarch64 @@ -9,28 +9,28 @@ LABEL maintainer="chbmb" RUN \ echo "**** install build packages ****" && \ - apt-get update && \ - apt-get install -y \ - g++ \ - gcc \ - git \ - libffi-dev \ - libjpeg-dev \ - libxml2-dev \ - libxslt1-dev \ - python-pip \ - zlib1g-dev && \ + apt-get update && \ + apt-get install -y \ + g++ \ + gcc \ + git \ + libffi-dev \ + libjpeg-dev \ + libxml2-dev \ + libxslt1-dev \ + python-pip \ + zlib1g-dev && \ echo "**** install runtime packages ****" && \ - apt-get install -y \ - imagemagick \ - python-minimal && \ + apt-get install -y \ + imagemagick \ + python-minimal && \ echo "**** install calibre-web ****" && \ - if [ -z ${CALIBREWEB_RELEASE+x} ]; then \ - CALIBREWEB_RELEASE=$(curl -sX GET "https://api.github.com/repos/janeczku/calibre-web/releases/latest" \ - | awk '/tag_name/{print $4;exit}' FS='[""]'); \ - fi && \ - curl -o \ - /tmp/calibre-web.tar.gz -L \ + if [ -z ${CALIBREWEB_RELEASE+x} ]; then \ + CALIBREWEB_RELEASE=$(curl -sX GET "https://api.github.com/repos/janeczku/calibre-web/releases/latest" \ + | awk '/tag_name/{print $4;exit}' FS='[""]'); \ + fi && \ + curl -o \ + /tmp/calibre-web.tar.gz -L \ https://github.com/janeczku/calibre-web/archive/${CALIBREWEB_RELEASE}.tar.gz && \ mkdir -p \ /app/calibre-web && \ @@ -43,19 +43,21 @@ RUN \ pip install --no-cache-dir -U -r \ optional-requirements.txt && \ echo "**** cleanup ****" && \ - apt-get -y remove \ - g++ \ - gcc \ - git \ - libffi-dev \ - libjpeg-dev \ - libxml2-dev \ - libxslt1-dev \ - python-pip \ - zlib1g-dev && \ - apt-get -y autoremove && \ + apt-get -y purge \ + g++ \ + gcc \ + git \ + libffi-dev \ + libjpeg-dev \ + libxml2-dev \ + libxslt1-dev \ + python-pip \ + zlib1g-dev && \ + apt-get -y autoremove && \ rm -rf \ - /tmp/* + /tmp/* \ + /var/lib/apt/lists/* \ + /var/tmp/* # add local files COPY root/ / diff --git a/Dockerfile.armhf b/Dockerfile.armhf index d947a2a..3bef081 100644 --- a/Dockerfile.armhf +++ b/Dockerfile.armhf @@ -9,28 +9,28 @@ LABEL maintainer="chbmb" RUN \ echo "**** install build packages ****" && \ - apt-get update && \ - apt-get install -y \ - g++ \ - gcc \ - git \ - libffi-dev \ - libjpeg-dev \ - libxml2-dev \ - libxslt1-dev \ - python-pip \ - zlib1g-dev && \ + apt-get update && \ + apt-get install -y \ + g++ \ + gcc \ + git \ + libffi-dev \ + libjpeg-dev \ + libxml2-dev \ + libxslt1-dev \ + python-pip \ + zlib1g-dev && \ echo "**** install runtime packages ****" && \ - apt-get install -y \ - imagemagick \ - python-minimal && \ + apt-get install -y \ + imagemagick \ + python-minimal && \ echo "**** install calibre-web ****" && \ - if [ -z ${CALIBREWEB_RELEASE+x} ]; then \ - CALIBREWEB_RELEASE=$(curl -sX GET "https://api.github.com/repos/janeczku/calibre-web/releases/latest" \ - | awk '/tag_name/{print $4;exit}' FS='[""]'); \ - fi && \ - curl -o \ - /tmp/calibre-web.tar.gz -L \ + if [ -z ${CALIBREWEB_RELEASE+x} ]; then \ + CALIBREWEB_RELEASE=$(curl -sX GET "https://api.github.com/repos/janeczku/calibre-web/releases/latest" \ + | awk '/tag_name/{print $4;exit}' FS='[""]'); \ + fi && \ + curl -o \ + /tmp/calibre-web.tar.gz -L \ https://github.com/janeczku/calibre-web/archive/${CALIBREWEB_RELEASE}.tar.gz && \ mkdir -p \ /app/calibre-web && \ @@ -43,19 +43,25 @@ RUN \ pip install --no-cache-dir -U -r \ optional-requirements.txt && \ echo "**** cleanup ****" && \ - apt-get -y remove \ - g++ \ - gcc \ - git \ - libffi-dev \ - libjpeg-dev \ - libxml2-dev \ - libxslt1-dev \ - python-pip \ - zlib1g-dev && \ - apt-get -y autoremove && \ + apt-get -y purge \ + g++ \ + gcc \ + git \ + libffi-dev \ + libjpeg-dev \ + libxml2-dev \ + libxslt1-dev \ + python-pip \ + zlib1g-dev && \ + apt-get -y autoremove && \ rm -rf \ - /tmp/* + /tmp/* \ + /var/lib/apt/lists/* \ + /var/tmp/* # add local files -COPY root/ / \ No newline at end of file +COPY root/ / + +# ports and volumes +EXPOSE 8083 +VOLUME /books /config diff --git a/Jenkinsfile b/Jenkinsfile index 7bc6d9e..0dacc24 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -475,6 +475,7 @@ pipeline { docker tag lsiodev/buildcache:arm64v8-${COMMIT_SHA}-${BUILD_NUMBER} ${IMAGE}:arm64v8-${META_TAG} fi docker run --rm \ + --shm-size=1gb \ -v /var/run/docker.sock:/var/run/docker.sock \ -e IMAGE=\"${IMAGE}\" \ -e DELAY_START=\"${CI_DELAY}\" \ diff --git a/readme-vars.yml b/readme-vars.yml index 493cc2b..d7cc4bb 100644 --- a/readme-vars.yml +++ b/readme-vars.yml @@ -9,7 +9,6 @@ project_blurb: | [{{ project_name|capitalize }}]({{ project_url }}) is a web app providing a clean interface for browsing, reading and downloading eBooks using an existing Calibre database. It is also possible to integrate google drive and edit metadata and your calibre library through the app itself. This software is a fork of library and licensed under the GPL v3 License. -project_blurb_optional_extras_enabled: false # supported architectures available_architectures: @@ -17,13 +16,9 @@ available_architectures: - { arch: "{{ arch_arm64 }}", tag: "arm64v8-latest"} - { arch: "{{ arch_armhf }}", tag: "arm32v7-latest"} -# development version -development_versions: false - # container parameters common_param_env_vars_enabled: true param_container_name: "{{ project_name }}" -param_usage_include_net: false param_usage_include_env: true param_env_vars: - { env_var: "TZ", env_value: "Europe/London", desc: "Specify a timezone to use EG Europe/London." } @@ -34,8 +29,6 @@ param_volumes: param_usage_include_ports: true param_ports: - { external_port: "8083", internal_port: "8083", port_desc: "WebUI" } -param_device_map: false -cap_add_param: false # optional container parameters opt_param_usage_include_env: false diff --git a/root/etc/cont-init.d/30-config b/root/etc/cont-init.d/30-config index e5081a3..17cefcb 100644 --- a/root/etc/cont-init.d/30-config +++ b/root/etc/cont-init.d/30-config @@ -18,11 +18,11 @@ # create Google drive client_secrets.json file [[ ! -f /config/client_secrets.json ]] && \ - echo "{}" > /config/client_secrets.json + echo "{}" > /config/client_secrets.json [[ -f /app/calibre-web/client_secrets.json ]] && - rm /app/calibre-web/client_secrets.json + rm /app/calibre-web/client_secrets.json [[ ! -L /app/calibre-web/client_secrets.json ]] && - ln -s /config/client_secrets.json /app/calibre-web/client_secrets.json + ln -s /config/client_secrets.json /app/calibre-web/client_secrets.json # create Google drive symlinks for database [[ ! -f /config/gdrive.db ]] && \