You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

Dockerfile中apt-get update执行失败的问题求助

Dockerfile中apt-get update执行失败的问题求助

各位大佬好,我遇到一个Dockerfile构建时的问题,想请教下怎么解决:

我在Mac上运行minikube,版本信息是:

minikube version: v1.24.0 commit: 76b94fb3c4e8ac5062daf70d60cf03ddcc0a741b

用VirtualBox作为VM驱动,启动命令是:

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

我用docker-compose来运行镜像,docker-compose.yaml里相关的配置如下:

version: "3.7"

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

对应的Dockerfile开头几行是这样的:

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

之前这个配置一直运行正常,但最近突然不行了,我自己这边没改任何配置。现在构建时Python镜像能正常拉取,但apt-get update命令执行失败了,错误信息如下:

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

有没有大佬知道这个问题该怎么解决呀?

备注:内容来源于stack exchange,提问作者Carabes

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.04.22 10:50:39