From a2086ce62679858ff3c01129d7043ecc4076edd7 Mon Sep 17 00:00:00 2001 From: Ayaz Salikhov Date: Thu, 28 May 2020 10:41:26 +0200 Subject: [PATCH] Start using Ubuntu 20.04 (focal) --- base-notebook/Dockerfile | 6 ++-- docs/using/recipes.md | 38 +++++++++------------- examples/docker-compose/bin/letsencrypt.sh | 2 +- minimal-notebook/Dockerfile | 2 +- 4 files changed, 20 insertions(+), 28 deletions(-) diff --git a/base-notebook/Dockerfile b/base-notebook/Dockerfile index 49b30e8da5..4c62399de0 100644 --- a/base-notebook/Dockerfile +++ b/base-notebook/Dockerfile @@ -1,10 +1,10 @@ # Copyright (c) Jupyter Development Team. # Distributed under the terms of the Modified BSD License. -# Ubuntu 18.04 (bionic) -# https://hub.docker.com/_/ubuntu/?tab=tags&name=bionic +# Ubuntu 20.04 (focal) +# https://hub.docker.com/_/ubuntu/?tab=tags&name=focal # OS/ARCH: linux/amd64 -ARG ROOT_CONTAINER=ubuntu:bionic-20200403@sha256:b58746c8a89938b8c9f5b77de3b8cf1fe78210c696ab03a1442e235eea65d84f +ARG ROOT_CONTAINER=ubuntu:focal-20200423@sha256:238e696992ba9913d24cfc3727034985abd136e08ee3067982401acdc30cbf3f ARG BASE_CONTAINER=$ROOT_CONTAINER FROM $BASE_CONTAINER diff --git a/docs/using/recipes.md b/docs/using/recipes.md index 9afb558696..dabc30dca0 100644 --- a/docs/using/recipes.md +++ b/docs/using/recipes.md @@ -259,38 +259,30 @@ RUN rm /etc/dpkg/dpkg.cfg.d/excludes \ && apt-get clean \ && rm -rf /var/lib/apt/lists/* -# Workaround for a mandb bug, should be fixed in mandb > 2.8.5 -# https://git.savannah.gnu.org/cgit/man-db.git/commit/?id=8197d7824f814c5d4b992b4c8730b5b0f7ec589a -RUN echo "MANPATH_MAP ${CONDA_DIR}/bin ${CONDA_DIR}/man" >> /etc/manpath.config \ - && echo "MANPATH_MAP ${CONDA_DIR}/bin ${CONDA_DIR}/share/man" >> /etc/manpath.config \ - && mandb - USER $NB_UID ``` Adding the documentation on top of an existing singleuser image wastes a lot of space and requires reinstalling every system package, which can take additional time and bandwidth; the `datascience-notebook` image has been shown to grow by almost 3GB when adding manapages in this way. -Enabling manpages in the base Ubuntu layer prevents this container bloat: +Enabling manpages in the base Ubuntu layer prevents this container bloat. +Just use previous `Dockerfile` with original ubuntu image as your base container: -```Dockerfile -# Ubuntu 18.04 (bionic) from 2018-05-26 -# https://github.com/docker-library/official-images/commit/aac6a45b9eb2bffb8102353c350d341a410fb169 -ARG BASE_CONTAINER=ubuntu:bionic-20180526@sha256:c8c275751219dadad8fa56b3ac41ca6cb22219ff117ca98fe82b42f24e1ba64e -FROM $BASE_CONTAINER - -ENV DEBIAN_FRONTEND noninteractive -# Remove the manpage blacklist, install man, install docs -RUN rm /etc/dpkg/dpkg.cfg.d/excludes \ - && apt-get update \ - && dpkg -l | grep ^ii | cut -d' ' -f3 | xargs apt-get install -yq --no-install-recommends --reinstall man \ - && apt-get clean \ - && rm -rf /var/lib/apt/lists/* +```dockerfile +# Ubuntu 20.04 (focal) from 2020-04-23 +# https://github.com/docker-library/official-images/commit/4475094895093bcc29055409494cce1e11b52f94 +ARG BASE_CONTAINER=ubuntu:focal-20200423@sha256:238e696992ba9913d24cfc3727034985abd136e08ee3067982401acdc30cbf3f +``` -# Workaround for a mandb bug, should be fixed in mandb > 2.8.5 +For Ubuntu 18.04 (bionic) and earlier, you may also require to workaround for a mandb bug, which was fixed in mandb >= 2.8.6.1: +```dockerfile # https://git.savannah.gnu.org/cgit/man-db.git/commit/?id=8197d7824f814c5d4b992b4c8730b5b0f7ec589a -RUN echo "MANPATH_MAP /opt/conda/bin /opt/conda/man" >> /etc/manpath.config \ - && echo "MANPATH_MAP /opt/conda/bin /opt/conda/share/man" >> /etc/manpath.config +# http://launchpadlibrarian.net/435841763/man-db_2.8.5-2_2.8.6-1.diff.gz + +RUN echo "MANPATH_MAP ${CONDA_DIR}/bin ${CONDA_DIR}/man" >> /etc/manpath.config \ + && echo "MANPATH_MAP ${CONDA_DIR}/bin ${CONDA_DIR}/share/man" >> /etc/manpath.config \ + && mandb + ``` Be sure to check the current base image in `base-notebook` before building. diff --git a/examples/docker-compose/bin/letsencrypt.sh b/examples/docker-compose/bin/letsencrypt.sh index 34462605cd..4774713fbe 100755 --- a/examples/docker-compose/bin/letsencrypt.sh +++ b/examples/docker-compose/bin/letsencrypt.sh @@ -43,6 +43,6 @@ docker run --rm -it \ # directory so that the FQDN doesn't have to be known later. docker run --rm -it \ -v $SECRETS_VOLUME:/etc/letsencrypt \ - ubuntu:18.04 \ + ubuntu:20.04 \ bash -c "ln -s /etc/letsencrypt/live/$FQDN/* /etc/letsencrypt/ && \ find /etc/letsencrypt -type d -exec chmod 755 {} +" diff --git a/minimal-notebook/Dockerfile b/minimal-notebook/Dockerfile index fe845c43a5..8b4051d62b 100644 --- a/minimal-notebook/Dockerfile +++ b/minimal-notebook/Dockerfile @@ -24,7 +24,7 @@ RUN apt-get update && apt-get install -yq --no-install-recommends \ # ---- nbconvert dependencies ---- texlive-xetex \ texlive-fonts-recommended \ - texlive-generic-recommended \ + texlive-plain-generic \ # Optional dependency texlive-fonts-extra \ # ----