chesterli29 / jupyterlab_tensorboard

Tensorboard extension for jupyterlab.
MIT License
314 stars 36 forks source link

Building from jupyter/* containers generates error when running apt update #57

Open ianmaddox opened 1 year ago

ianmaddox commented 1 year ago

Using a very simple Dockerfile

# Copyright (c) Jupyter Development Team.
# Distributed under the terms of the Modified BSD License.
#ARG BASE_CONTAINER=jupyter/scipy-notebook
ARG BASE_CONTAINER=jupyter/tensorflow-notebook
FROM $BASE_CONTAINER

# Fix: https://github.com/hadolint/hadolint/wiki/DL4006
# Fix: https://github.com/koalaman/shellcheck/wiki/SC3014
SHELL ["/bin/bash", "-o", "pipefail", "-c"]

RUN pip install tensorboard

RUN apt-get update --yes
RUN apt-get install --yes --no-install-recommends \
    nodejs npm
RUN apt-get clean && rm -rf /var/lib/apt/lists/*

Building the container results in this error:

#6 14.72 Get:17 http://archive.ubuntu.com/ubuntu jammy-backports/main amd64 Packages [49.4 kB]
#6 15.16 Get:18 http://archive.ubuntu.com/ubuntu jammy-backports/universe amd64 Packages [23.3 kB]
#6 15.21 Fetched 26.5 MB in 15s (1,785 kB/s)
#6 15.21 Reading package lists...
#6 16.25 E: Problem executing scripts APT::Update::Post-Invoke 'rm -f /var/cache/apt/archives/*.deb /var/cache/apt/archives/partial/*.deb /var/cache/apt/*.bin || true'
#6 16.25 E: Sub-process returned an error code
ianmaddox commented 1 year ago

The workaround is simple. Add the line below before you run the apt command:

RUN mv /etc/apt/apt.conf.d/docker-clean{,.disabled}

This disables an apt post-execution script that is throwing an error trying to delete things that don't exist.