无法使用pycharm成功运行dockerfile

问题描述 投票:0回答:1

当我使用代码运行 dockerfile 时

FROM python:3.10-slim as builder

WORKDIR /app

ENV PYTHONDONTWRITEBYTECODE 1
ENV PYTHONUNBUFFERED 1

RUN apt-get update && apt-get install -y --no-install-recommends gcc

COPY . .
RUN pip wheel --no-cache-dir --no-deps --wheel-dir /wheels -r requirements.txt


# final stage
FROM python:3.10-slim

WORKDIR /app

COPY --from=builder /wheels /wheels
COPY --from=builder /app .

RUN pip install --no-cache /wheels/*
CMD ["python", "main.py"]

失败并出现以下错误。

enter image description here

谁能告诉我出了什么问题?

windows docker pycharm
1个回答
0
投票

apt-get update && apt-get install -y build-essential
一开始就应该解决它。

© www.soinside.com 2019 - 2024. All rights reserved.