【发布时间】:2020-10-24 02:26:16
【问题描述】:
我正在尝试根据requirements.txt 中指定的要求构建 docker 映像。但是,在尝试构建文件时,我收到以下错误:
E: Failed to fetch http://us.archive.ubuntu.com/ubuntu/pool/main/l/linux-atm/libatm1_2.5.1-1.5_amd64.deb 400 Bad Request [IP: 91.189.91.39 80]
E: Failed to fetch http://us.archive.ubuntu.com/ubuntu/pool/main/p/popt/libpopt0_1.16-10_amd64.deb 400 Bad Request [IP: 91.189.91.39 80]
E: Failed to fetch http://us.archive.ubuntu.com/ubuntu/pool/main/libc/libcap-ng/libcap-ng0_0.7.7-1_amd64.deb 400 Bad Request [IP: 91.189.91.39 80]
我已尝试更改镜像,已检查 cat /etc/apt/sources.list 的输出,已尝试添加标志 --fix-missing 并尝试使用 --no-cache 构建映像全部为否利用。
这里是 Dockerfile:
# Base image
FROM ubuntu:16.04
MAINTAINER Siddhanth Ajri "y2jsiddajri@gmail.com"
RUN cat /etc/apt/sources.list
# Changing to US archives of UBUNTU
RUN sed -i'' 's/archive\.ubuntu\.com/us\.archive\.ubuntu\.com/' /etc/apt/sources.list
# Install dependencies
RUN apt-get update && apt-get install -y \
software-properties-common \
curl \
git
#RUN add-apt-repository universe
RUN apt-get update && apt-get install -y \
curl \
git
RUN apt-get install python3.7
RUN apt-get install python3-pip
# Upgrade pip to 20.x
RUN pip3 install -U pip
COPY ./requirements.txt /requirements.txt
WORKDIR /
RUN pip3 install -r requirements.txt
COPY . /
到目前为止,我找到的上述解决方案都无法为我解决此问题。
【问题讨论】:
-
StackOverflow 致力于帮助解决编程代码问题。您的 Q 可能更适合 Unix & Linux 或 Super User ,但请阅读他们关于主题问题的帮助部分。并且请先阅读Help On-topic 和Help How-to-ask,然后再在此处发布更多问题。祝你好运。
标签: linux docker ubuntu ubuntu-16.04 apt-get