From 0a69df4f2ce5a0282475a1ec083da3ff97199333 Mon Sep 17 00:00:00 2001 From: riccardoporreca Date: Fri, 1 Nov 2019 13:02:42 +0000 Subject: [PATCH 1/4] Use version-stable TinyTeX for the deployed app. * Fixes #152. --- Dockerfile | 6 ++++-- docker/install_tinytex.sh | 6 ++++++ 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/Dockerfile b/Dockerfile index 875d6a9..1bae8c6 100644 --- a/Dockerfile +++ b/Dockerfile @@ -27,9 +27,11 @@ ENV PANDOC_DEB="2.3.1/pandoc-2.3.1-1-amd64.deb" COPY docker/install_pandoc.sh . RUN sh install_pandoc.sh $PANDOC_DEB && rm install_pandoc.sh -## Install TinyTeX as LaTeX installation, including the app-specific dependencies -# NOTE: it is important to install all required LaTeX packages when building the image! +## Install TinyTeX as LaTeX installation +# - use a version-stable tlnet archive CTAN date: frozen 2018 TeXLive snapshot +# - it is important to also install all required LaTeX packages when building the image COPY docker/install_tinytex.sh . +ENV CTAN_DATE=2019/02/27 RUN sh install_tinytex.sh fancyhdr ## Script for re-installation of TinyTeX in the running container # - needed if at a certain point the "Remote repository is newer than local" diff --git a/docker/install_tinytex.sh b/docker/install_tinytex.sh index 6572ac7..2b9185d 100644 --- a/docker/install_tinytex.sh +++ b/docker/install_tinytex.sh @@ -5,6 +5,12 @@ # - texinfo (for TinyTeX) # - ghostscript (for pdfcrop) +## Install TinyTeX from date-locked CTAN tlnet archive. This is inspired by +## rocker/r-ver, and the TZ is probably still fine in this context +[ -z "$CTAN_DATE" ] && CTAN_DATE=$(TZ="America/Los_Angeles" date +%Y/%m/%d) || true \ +&& CTAN_REPO=https://www.texlive.info/tlnet-archive/${CTAN_DATE}/tlnet \ +&& export CTAN_REPO + ## Admin-based install of TinyTeX: install2.r --error --skipinstalled tinytex \ && wget -qO- \ From b55f558a336d4db23d15e9766aa917ff7f6da87e Mon Sep 17 00:00:00 2001 From: riccardoporreca Date: Fri, 1 Nov 2019 14:26:05 +0000 Subject: [PATCH 2/4] Use .dockerignore to limit the build context and improve caching (#152). --- .Rbuildignore | 1 + .dockerignore | 8 ++++++++ 2 files changed, 9 insertions(+) create mode 100644 .dockerignore diff --git a/.Rbuildignore b/.Rbuildignore index 328518f..e6b50ed 100644 --- a/.Rbuildignore +++ b/.Rbuildignore @@ -6,6 +6,7 @@ ^.*\.Rproj$ ^Dockerfile$ +^\.dockerignore$ ^docker$ ^cloudbuild\.yaml$ ^gke$ diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 0000000..5d7e2af --- /dev/null +++ b/.dockerignore @@ -0,0 +1,8 @@ +# Exclude hidden files/dirs to cover items related to git checkout, R project +# and R session, which would be present in local builds and affect caching +.* +# .Rbuildignore however is relevant for the package build and must be kept +!.Rbuildignore + +# Exclude the Dockerfile so that it does not affect caching either +Dockerfile From 85c297f77f24d1b19fc77066b12f5fd849fe935c Mon Sep 17 00:00:00 2001 From: riccardoporreca Date: Fri, 1 Nov 2019 14:29:43 +0000 Subject: [PATCH 3/4] Include #152 in NEWS.md --- NEWS.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/NEWS.md b/NEWS.md index f4beccd..e3622f1 100644 --- a/NEWS.md +++ b/NEWS.md @@ -3,7 +3,7 @@ ### Changes * The app now uses custom collapsible panels, removing the dependency on shinydashboardPlus (#113). -* The Dockerfile for the deployed app was improved, and is now based on R 3.5.3 (#91). +* The Dockerfile for the deployed app was improved, and is now based on R 3.5.3 (#91, #152). * The total retirement fund text in the app was improved (#114). * The PDF report now uses A4 as pages size (#131). * The increment of interest rates in the app is now aligned to 0.1% (#142). From 4ef96c647648b47171b50813841286f1b1f9e7b8 Mon Sep 17 00:00:00 2001 From: riccardoporreca Date: Tue, 5 Nov 2019 10:40:31 +0100 Subject: [PATCH 4/4] Revises version-stable TinyTeX, aligned with Debian stretch TeXLive release. * See comments in #152. --- Dockerfile | 12 ++++++++---- docker/Dockerfile-test-scripts | 5 ++++- docker/install_tinytex.sh | 6 ------ 3 files changed, 12 insertions(+), 11 deletions(-) diff --git a/Dockerfile b/Dockerfile index 1bae8c6..ce5dfff 100644 --- a/Dockerfile +++ b/Dockerfile @@ -28,13 +28,17 @@ COPY docker/install_pandoc.sh . RUN sh install_pandoc.sh $PANDOC_DEB && rm install_pandoc.sh ## Install TinyTeX as LaTeX installation -# - use a version-stable tlnet archive CTAN date: frozen 2018 TeXLive snapshot -# - it is important to also install all required LaTeX packages when building the image COPY docker/install_tinytex.sh . -ENV CTAN_DATE=2019/02/27 +# - Use a version-stable tlnet archive CTAN repo from texlive.info +# - here we consider the frozen TeXLive 2016 snapshot, corresponding to the TeXLive release +# shipped as texlive-* in Debian stretch (base image for the rocker/verse currently used) +# - note that https was not supported in TeXLive 2016 for the CTAN repository +ENV CTAN_REPO=http://www.texlive.info/tlnet-archive/2017/04/13/tlnet +# - It is important to also install all required LaTeX packages when building the image RUN sh install_tinytex.sh fancyhdr ## Script for re-installation of TinyTeX in the running container -# - needed if at a certain point the "Remote repository is newer than local" +# - needed if at a certain point the "Remote repository is newer than local", +# for non-version-stable TinyTeX installations # - this also (re-)executes (and therefore depends on) install_tinytex.sh COPY docker/reinstall_tinytex.sh . diff --git a/docker/Dockerfile-test-scripts b/docker/Dockerfile-test-scripts index dd8edad..9882345 100644 --- a/docker/Dockerfile-test-scripts +++ b/docker/Dockerfile-test-scripts @@ -23,8 +23,11 @@ RUN sh install_pandoc.sh $PANDOC_DEB # TinyTeX COPY docker/install_tinytex.sh . +# Use the frozen TeXLive 2018 snapshot as version-stable tlnet CTAN archive +ENV CTAN_REPO=http://www.texlive.info/tlnet-archive/2019/02/27/tlnet RUN sh install_tinytex.sh fancyhdr # Re-installation of TinyTeX, to be used inside a running container in case the -# TeXLive local repo becomes obsolete (Remote repository is newer than local) +# TeXLive local repo becomes obsolete (Remote repository is newer than local), +# in case of non-version-stable TinyTeX installs COPY docker/reinstall_tinytex.sh . diff --git a/docker/install_tinytex.sh b/docker/install_tinytex.sh index 2b9185d..6572ac7 100644 --- a/docker/install_tinytex.sh +++ b/docker/install_tinytex.sh @@ -5,12 +5,6 @@ # - texinfo (for TinyTeX) # - ghostscript (for pdfcrop) -## Install TinyTeX from date-locked CTAN tlnet archive. This is inspired by -## rocker/r-ver, and the TZ is probably still fine in this context -[ -z "$CTAN_DATE" ] && CTAN_DATE=$(TZ="America/Los_Angeles" date +%Y/%m/%d) || true \ -&& CTAN_REPO=https://www.texlive.info/tlnet-archive/${CTAN_DATE}/tlnet \ -&& export CTAN_REPO - ## Admin-based install of TinyTeX: install2.r --error --skipinstalled tinytex \ && wget -qO- \