Docker Compose:Apt-utils 安装问题

问题描述 投票:0回答:2

我尝试在 Docker Compose 中构建新镜像,但出现以下问题

E: Failed to fetch http://archive.ubuntu.com/ubuntu/pool/main/a/apt/apt-utils_2.4.7_amd64.deb  404  Not Found [IP: ]
E: Unable to fetch some archives, maybe run apt-get update or try with --fix-missing?
The command '/bin/sh -c apt-get install -y apt-utils' returned a non-zero code: 100
ERROR: Service 'nginx-service' failed to build : Build failed

在我的 Dockerfile 中,我正在运行:

RUN apt-get install -y apt-utils
--fix-missing

相关问题或其他解决方案都没有帮助我,我已经被困了很长一段时间了。我错过了什么?

谢谢!

编辑:整个 Dockerfile

FROM ubuntu:latest
RUN apt-get update 
RUN apt-get upgrade -y
RUN apt-get install -y nginx 
RUN apt-get clean 
RUN apt-get install -y curl
RUN apt-get install -y unzip
RUN apt-get install -y wget
RUN DEBIAN_FRONTEND=noninteractive TZ=Etc/UTC apt-get -y install tzdata
RUN apt-get install -y php php-xml php-curl php-fpm php-mysql 
RUN apt-get install -y apt-utils --fix-missing
RUN apt-get install -y php-zip --fix-missing
RUN apt-get install -y php-gd --fix-missing
RUN apt-get install -y mysql-server
RUN curl -sS https://getcomposer.org/installer -o composer-setup.php
RUN php composer-setup.php --install-dir=/usr/local/bin --filename=composer
RUN apt-get install -y nano
RUN apt-get install -y mc
RUN apt-get install -y systemctl
RUN systemctl start nginx.service
docker ubuntu docker-compose apt-get
2个回答
3
投票

通常,当我们构建新映像时,我们使用更新然后像这样安装

RUN apt-get update && apt-get install -y apt-utils

这将更新 apt 源列表并使软件包可供安装。

将此添加到您的

Dockerfile
应该可以解决问题。

如果您想一次安装多个,您可以添加如下所示的软件包:

RUN apt-get update && apt-get install -y \
  bzr \
  cvs \
  git \
  mercurial \
  subversion \

1
投票

像这样构建图像:

docker-compose build --no-cache
为我工作

© www.soinside.com 2019 - 2024. All rights reserved.