我正试图在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
通常,当我们构建新映像时,我们使用更新,然后像这样安装
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
像这样构建图像:docker-compose build --no-cache
为我工作