python - 无法使用 python docker image 使用已安装的包
问题描述
尝试在docker容器中执行cowsay命令,但出现bash: cowsay: not found。这种情况发生在 sl 包的情况下。我使用 python:3.9 图像。我的 Dockerfile -
FROM python:3.9
WORKDIR /usr/src/app
ENV PYTHONDONTWRITEBYTECODE 1
ENV PYTHONUNBUFFERED 1
RUN apt-get update && apt-get install -y cowsay && apt-get install -y sl
RUN pip install --upgrade pip
COPY ./requirements.txt .
RUN pip install -r requirements.txt
COPY . .
和 docker run 命令 -
docker run -it --entrypoint bash
解决方案
推荐阅读
- angular - Angular订阅链可观察
- machine-learning - 分类报告中的precision和recall是如何计算的?
- apache-kafka - 如何最好地将 Apache Kafka 定位为许多独立客户端的消息代理
- sql - 可以用内部联接替换相关子查询吗?
- python - 是什么导致 openCV 中的断言失败错误?
- javascript - 在 Meteor 中处理全局变量
- pandas - 您可以使用 Pandas 样式更改标题字体大小吗?
- selenium - Selenium - EventFiringWebDriver beforeFindBy 和 afterFindBy 方法多次触发相同的事件
- nsoperationqueue - NSOperationQueue 操作和操作计数已弃用。如何取消特定类的操作?
- java - 将方法(或 voids)传递给 Java ArrayList