pythonpip-这些包与使用docker安装rasa的需求文件中的哈希不匹配



我正在从这个docker文件构建这个图像

FROM python:3.8.0
WORKDIR /app
# Install system libraries
RUN apt-get update && 
apt-get install -y git && 
apt-get install -y gcc
# Install project dependencies
COPY ./requirements.txt .
RUN pip install --upgrade pip
RUN pip install --no-cache-dir -r requirements.txt --use-deprecated=legacy-resolver
# Don't use terminal buffering, print all to stdout / err right away
ENV PYTHONUNBUFFERED 1

这是我的要求.txt文件

aiohttp==3.6.2
rasa==2.4.1
rasa-sdk==2.4.1
# Rasa requirements
python-dateutil~=2.8
SQLAlchemy==1.3.23
gast==0.3.3

构建图像的命令

docker build -f base_Dockerfile -t rasa_base:latest

但是这显示了这个错误

#9 529.6 ERROR: THESE PACKAGES DO NOT MATCH THE HASHES FROM THE REQUIREMENTS FILE. If you have updated the package versions, please update the hashes. Otherwise, examine the package contents carefully; someone may have tampered with them.
#9 529.6     tensorflow<2.4,>=2.3 from https://files.pythonhosted.org/packages/10/f9/283e82c10958fc24eb120fea6c40f1d8a66507a85818de420138bbbf88bf/tensorflow-2.3.2-cp38-cp38-manylinux2010_x86_64.whl#sha256=c85d29c7b5c000b196200a25e18a5905cc04f75c989e508f8fd110f3b2c4b4fe (from rasa==2.4.1->-r requirements.txt (line 2)):
#9 529.6         Expected sha256 c85d29c7b5c000b196200a25e18a5905cc04f75c989e508f8fd110f3b2c4b4fe
#9 529.6              Got        c29a17cebd72dd06fecffd646fa0990c9b7f7b5781d8746b70d821109125f9c9
#9 529.6
------
executor failed running [/bin/sh -c pip install --no-cache-dir -r requirements.txt --use-deprecated=legacy-resolver]: exit code: 1

我已经删除了所有的图像,甚至在安装deps时我也在使用--no-cache-dir

问题在于缓存和未使用的图像。这个命令帮助了我

docker system prune -a

删除所有悬挂的图像。如果指定了-a,还将删除任何容器未引用的所有图像

最新更新