知识卡片
依赖导出要匹配工具版本分组
从锁定结果导出requirements供生产安装,可减少生产携带Poetry等工具。命令、插件和开发分组语法依Poetry版本,应核对并验证锁与导出一致;原书未固定版本,不能假定任何新版本都原样支持。
这张卡片看不懂?
这张卡片已通过人工审查,不再接受失败反馈。
已有反馈 · 0 条
还没有人提交反馈。
在整书笔记中的位置
- · 依赖管理实践
原书出处 · 1 处
- · 查看原书依据
RUN poetry export --without dev --format requirements.txt \ --output requirements.txt FROM python:3.10-slim-bookworm AS prod WORKDIR /code COPY src /code/src COPY scripts /code/scripts COPY artifacts /code/artifacts COPY --from=builder /code/requirements.txt /code RUN pip install --no-cache-dir -r /code/requirements.txt CMD ["./scripts/start-api-prod.sh"] The first stage (dev) will create a dev image that batect will use when running ./batect setup. After batect installs all the development dependencies, the container becomes 1.3
参考来源
- 位置:《Effective Machine Learning Teams (David Tan, Ada Leung, David Colls)》第04章《依赖管理实践》(来源项目:a19c7933-4eda-4176-aebd-30fe7e1ad292;源文件:extracted/Effective Machine Learning Teams (David Tan, Ada Leung, David Colls)/_epub-src/OEBPS/ch04.html)
- 结论依据:摘录中关于依赖导出要匹配工具版本分组的定义、比较或条件支撑卡片;原书表述不严谨的范围已在覆盖记录逐项限定,不把案例结果外推为普遍结论。
- 原始内容:RUN poetry export --without dev --format requirements.txt \ --output requirements.txt FROM python:3.10-slim-bookworm AS prod WORKDIR /code COPY src /code/src COPY scripts /code/scripts COPY artifacts /code/artifacts COPY --from=builder /code/requirements.txt /code RUN pip install --no-cache-dir -r /code/requirements.txt CMD ["./scripts/start-api-prod.sh"] The first stage (dev) will create a dev image that batect will use when running ./batect setup. After batect installs all the development dependencies, the container becomes 1.3