【问题标题】:Bad Request (400) message every time I try to build my Docker Ubuntu 16:04 image每次尝试构建 Docker Ubuntu 16:04 映像时出现错误请求 (400) 消息
【发布时间】: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


【解决方案1】:

我在这里找到了一个对我有帮助的解决方案:https://www.kubuntuforums.net/showthread.php?57567-Ubuntu-problems-on-update

您可以让 apt-get 使用以下方法重新生成列表缓存:

sudo apt-get clean
cd /var/lib/apt
sudo mv lists lists.old
sudo mkdir -p lists/partial
sudo apt-get clean
sudo apt-get update

【讨论】:

    猜你喜欢
    • 2020-12-24
    • 1970-01-01
    • 1970-01-01
    • 2020-11-16
    • 2021-05-13
    • 2019-10-10
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多