Pur*_*ome 10 python opencv docker
我正在尝试创建一个自定义 Docker 映像,在其中一个RUN步骤中,我被要求选择一些“菜单”选项..这会挂起/停止映像继续/生成。
这是 Dockerfile:
FROM ubuntu:latest
RUN apt update
# install OpenCV
RUN apt install python3-opencv -y
# Test that OpenCV has been installed
RUN python3 -c "import cv2; print(cv2.__version__)"
Run Code Online (Sandbox Code Playgroud)
这是构建输出中的最后几行:
....
Setting up libsnappy1v5:amd64 (1.1.8-1build1) ...
Setting up poppler-data (0.4.9-2) ...
Setting up libkrb5support0:amd64 (1.17-6ubuntu4) ...
Setting up libsasl2-modules-db:amd64 (2.1.27+dfsg-2) ...
Setting up tzdata (2020a-0ubuntu0.20.04) ...
debconf: unable to initialize frontend: Dialog
debconf: (TERM is not set, so the dialog frontend is not usable.)
debconf: falling back to frontend: Readline
Configuring tzdata
------------------
Please select the geographic area in which you live. Subsequent configuration
questions will narrow this down by presenting a list of cities, representing
the time zones in which they are located.
1. Africa 4. Australia 7. Atlantic 10. Pacific 13. Etc
2. America 5. Arctic 8. Europe 11. SystemV
3. Antarctica 6. Asia 9. Indian 12. US
Geographic area:
Run Code Online (Sandbox Code Playgroud)
这是第三步的一部分=>RUN p3 p3-opencv
我怎样才能让这一步自动完成?我猜测在尝试安装时python-opencv我缺少依赖项和/或需要更新一些依赖项。这很好,它正在尝试更新/安装这些,但需要一些用户交互。
小智 13
您可以使用DEBIAN_FRONTEND=noninteractive
FROM ubuntu:latest
RUN apt update
ENV DEBIAN_FRONTEND=noninteractive
# install OpenCV
RUN apt install python3-opencv -y
# Test that OpenCV has been installed
RUN python3 -c "import cv2; print(cv2.__version__)"
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
2646 次 |
| 最近记录: |