From 823ae24b8494554fa09d8d19b6af8f94ade10af7 Mon Sep 17 00:00:00 2001 From: thelamer Date: Tue, 4 Jun 2019 20:48:24 -0700 Subject: [PATCH] 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 ]] && \