Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
ianmaddox opened this issue Apr 14, 2023 · 1 comment

Comments

@ianmaddox
Copy link

ianmaddox commented Apr 14, 2023

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
Copy link
Author

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant