From b6074f4eb33ee1a7b2d5c30475383f41f6656d02 Mon Sep 17 00:00:00 2001 From: Ryan Lovett Date: Thu, 8 Aug 2024 10:08:34 -0700 Subject: [PATCH 1/4] Enable man. Enabling man could possibly bloat the datahub image. Undo this if it increases the size too much. --- deployments/datahub/images/default/Dockerfile | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/deployments/datahub/images/default/Dockerfile b/deployments/datahub/images/default/Dockerfile index 29f185043..5c53faf7a 100644 --- a/deployments/datahub/images/default/Dockerfile +++ b/deployments/datahub/images/default/Dockerfile @@ -21,6 +21,17 @@ RUN apt-get -qq update --yes && \ RUN adduser --disabled-password --gecos "Default Jupyter user" ${NB_USER} +# Do not exclude manpages from being installed. +RUN sed -i -e '/usr.share.man/s/^/#/' exclude + +# From docker-ce-packaging +# Remove diverted man binary to prevent man-pages being replaced with "minimized" message. See docker/for-linux#639 +RUN if [ "$(dpkg-divert --truename /usr/bin/man)" = "/usr/bin/man.REAL" ]; then \ + rm -f /usr/bin/man; \ + dpkg-divert --quiet --remove --rename /usr/bin/man; \ + fi +RUN mandb -c + # Install all apt packages COPY apt.txt /tmp/apt.txt RUN apt-get -qq update --yes && \ From 48258977e861e67ac50782eafaa8139e51dee4fb Mon Sep 17 00:00:00 2001 From: Ryan Lovett Date: Thu, 8 Aug 2024 10:12:34 -0700 Subject: [PATCH 2/4] Specify dpkg exclude file properly. --- deployments/datahub/images/default/Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/deployments/datahub/images/default/Dockerfile b/deployments/datahub/images/default/Dockerfile index 5c53faf7a..ae893bf5e 100644 --- a/deployments/datahub/images/default/Dockerfile +++ b/deployments/datahub/images/default/Dockerfile @@ -22,7 +22,7 @@ RUN apt-get -qq update --yes && \ RUN adduser --disabled-password --gecos "Default Jupyter user" ${NB_USER} # Do not exclude manpages from being installed. -RUN sed -i -e '/usr.share.man/s/^/#/' exclude +RUN sed -i -e '/usr.share.man/s/^/#/' /etc/dpkg/dpkg.cfg.d/exclude # From docker-ce-packaging # Remove diverted man binary to prevent man-pages being replaced with "minimized" message. See docker/for-linux#639 From bda73ad96bcd90658fb92cd31a5794a1626109e2 Mon Sep 17 00:00:00 2001 From: Ryan Lovett Date: Thu, 8 Aug 2024 10:19:54 -0700 Subject: [PATCH 3/4] Reorder commands. --- deployments/datahub/images/default/Dockerfile | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/deployments/datahub/images/default/Dockerfile b/deployments/datahub/images/default/Dockerfile index ae893bf5e..5c5faf14e 100644 --- a/deployments/datahub/images/default/Dockerfile +++ b/deployments/datahub/images/default/Dockerfile @@ -21,6 +21,15 @@ RUN apt-get -qq update --yes && \ RUN adduser --disabled-password --gecos "Default Jupyter user" ${NB_USER} +# Install all apt packages +COPY apt.txt /tmp/apt.txt +RUN apt-get -qq update --yes && \ + apt-get -qq install --yes --no-install-recommends \ + $(grep -v ^# /tmp/apt.txt) && \ + apt-get -qq purge && \ + apt-get -qq clean && \ + rm -rf /var/lib/apt/lists/* + # Do not exclude manpages from being installed. RUN sed -i -e '/usr.share.man/s/^/#/' /etc/dpkg/dpkg.cfg.d/exclude @@ -30,16 +39,8 @@ RUN if [ "$(dpkg-divert --truename /usr/bin/man)" = "/usr/bin/man.REAL" ]; then rm -f /usr/bin/man; \ dpkg-divert --quiet --remove --rename /usr/bin/man; \ fi -RUN mandb -c -# Install all apt packages -COPY apt.txt /tmp/apt.txt -RUN apt-get -qq update --yes && \ - apt-get -qq install --yes --no-install-recommends \ - $(grep -v ^# /tmp/apt.txt) && \ - apt-get -qq purge && \ - apt-get -qq clean && \ - rm -rf /var/lib/apt/lists/* +RUN mandb -c # Create user owned R libs dir # This lets users temporarily install packages From 430d86597ebb2fffbabef80c13e84305f35c5430 Mon Sep 17 00:00:00 2001 From: Ryan Lovett Date: Thu, 8 Aug 2024 10:28:52 -0700 Subject: [PATCH 4/4] Pass correct path. --- deployments/datahub/images/default/Dockerfile | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/deployments/datahub/images/default/Dockerfile b/deployments/datahub/images/default/Dockerfile index 5c5faf14e..49062d34d 100644 --- a/deployments/datahub/images/default/Dockerfile +++ b/deployments/datahub/images/default/Dockerfile @@ -21,6 +21,9 @@ RUN apt-get -qq update --yes && \ RUN adduser --disabled-password --gecos "Default Jupyter user" ${NB_USER} +# Do not exclude manpages from being installed. +RUN sed -i -e '/usr.share.man/s/^/#/' /etc/dpkg/dpkg.cfg.d/excludes + # Install all apt packages COPY apt.txt /tmp/apt.txt RUN apt-get -qq update --yes && \ @@ -30,9 +33,6 @@ RUN apt-get -qq update --yes && \ apt-get -qq clean && \ rm -rf /var/lib/apt/lists/* -# Do not exclude manpages from being installed. -RUN sed -i -e '/usr.share.man/s/^/#/' /etc/dpkg/dpkg.cfg.d/exclude - # From docker-ce-packaging # Remove diverted man binary to prevent man-pages being replaced with "minimized" message. See docker/for-linux#639 RUN if [ "$(dpkg-divert --truename /usr/bin/man)" = "/usr/bin/man.REAL" ]; then \