gpt4 book ai didi

Docker 无法解决 : executor failed running. 退出代码:1

转载 作者:行者123 更新时间:2023-12-03 08:02:13 25 4
gpt4 key购买 nike

我正在尝试使用以下 Dockerfile 对我的 Django 项目进行 dockerize。

Dockerfile

FROM python:3.9-bullseye

WORKDIR /app

ENV PYTHONUNBUFFERED=1

COPY . .

RUN apt-get update \
&& apt-get upgrade pip \
&& pip install --upgrade pip \
&& pip lock -r > requirements.txt \
&& pip install -r requirements.txt

CMD ["ls"]

错误

#0 5.012 41 upgraded, 15 newly installed, 0 to remove and 0 not upgraded.
#0 5.012 Need to get 28.9 MB of archives.
#0 5.012 After this operation, 32.4 MB of additional disk space will be used.
#0 5.012 Do you want to continue? [Y/n] Abort.
------
failed to solve: executor failed running [/bin/sh -c apt-get update
&& apt-get upgrade pip && pip install --upgrade pip &&
pip lock -r > requirements.txt && pip install -r
requirements.txt]: exit code: 1

我在尝试docker-compose up时遇到此错误。我认为这是因为 python:3.9-bullseye 发行版的命令输入不正确。我是 Docker 新手,试图弄清楚 Linux 命令是什么。请帮我纠正这个问题。

最佳答案

通过检查日志输出

#0 7.873 Do you want to continue? [Y/n] Abort.

您应该传递标志-y以便自动接受apt相关命令中软件包的安装。

所以你应该尝试这样的事情

RUN apt-get update -y \
&& apt-get upgrade -y pip \
&& pip install --upgrade pip \

关于Docker 无法解决 : executor failed running. 退出代码:1,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/73680000/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com