Score:0

Using apt-get update in Dockerfile is not working

km flag

In my Mac, I'm running minikube, version minikube version: v1.24.0 commit: 76b94fb3c4e8ac5062daf70d60cf03ddcc0a741b

with VirtualBox, with this command minikube start --vm-driver virtualbox --docker-env=[REGISTRY_PATH="myregistrypath/",BASE_VERSION=local] -p mymachine

I'm using docker-compose to run the docker images. The relevant part of my docker-compose.yaml is

version: "3.7"
services:
  base:
    build:
      context: .
      dockerfile: build/base/Dockerfile
    image: mymachine/base:${MYMACHINE_BASE_VERSION}
    command: /bin/false

The Dockerfile corresponding to this begins with:

FROM python:3.8-slim
ENV DEBIAN_FRONTEND=noninteractive
RUN apt-get update

The python image is retrieved correctly but the apt-get update command fails. This was working correctly some days ago. Now it's not, I haven't changed anything from my side as far as I know.

The error I'm getting is:

Step 3/10 : RUN apt-get -y update
 ---> Running in 5fee40f42100
Get:1 http://deb.debian.org/debian bookworm InRelease [147 kB]
Get:2 http://deb.debian.org/debian bookworm-updates InRelease [52.1 kB]
Get:3 http://deb.debian.org/debian-security bookworm-security InRelease [48.0 kB]
Get:4 http://deb.debian.org/debian bookworm/main amd64 Packages [8904 kB]
Get:5 http://deb.debian.org/debian-security bookworm-security/main amd64 Packages [27.7 kB]
Fetched 9179 kB in 2s (5714 kB/s)
Reading package lists...
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'
E: Sub-process returned an error code

Any idea how to fix this?

pt flag
I'm unable to reproduce that problem locally. Have you tried pulling a new version of the `python:3.8-slim` image (`docker pull python:3.8-slim`)?
Carabes avatar
km flag
I changed to the 3.8 bullseye and that fixed the issue. I still have no idea what the problem is. I think It has to be a problem with my machine or configuration, because the other image is working on other machines
I sit in a Tesla and translated this thread with Ai:

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.