当我使用代码运行 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"]
失败并出现以下错误。
谁能告诉我出了什么问题?
apt-get update && apt-get install -y build-essential
一开始就应该解决它。