Docker pip install --no-cache-dir
具体解释
使用 --no-cache-dir
--no-cache-dirFROM python:3.9
WORKDIR /app
COPY requirements.txt .
# 安装依赖并避免缓存
RUN pip install --no-cache-dir -r requirements.txt
COPY . .
CMD ["python", "app.py"]缓存存储的默认路径
为什么 --no-cache-dir 重要?
--no-cache-dir 重要?总结
Last updated