如何解决如何在构建过程中使奇点输入命令行输入?
我已使用奇点从NVIDIA NGC检索了以下Docker映像:https://ngc.nvidia.com/catalog/containers/nvidia:cuda。
我将标签'11 .1-cudnn8-devel-ubuntu18.04'如下拉出:
singularity pull docker://nvcr.io/nvidia/cuda:11.1-cudnn8-devel-ubuntu18.04
然后该图像在本地以'cuda_11.1-cudnn8-devel-ubuntu18.04.sif'的形式提供。
然后,我尝试根据以下定义文件使用一些构建工具和一些Python来扩充此图像:
Bootstrap: localimage
From: cuda_11.1-cudnn8-devel-ubuntu18.04.sif
%post
apt-get update && apt-get install -y libopenmpi-dev make gcc pkg-config g++ python3 python3-sklearn python3-requests python3-bs4 python3-urllib3
如下:
singularity build --force --fakeroot cuda_11.1-cudnn8-python-devel-ubuntu18.04.sif cuda-python.def
在图像中安装tzdata
时,它要求用户输入以确定我的时区:
Setting up tzdata (2020a-0ubuntu0.18.04) ...
debconf: unable to initialize frontend: Dialog
debconf: (No usable dialog-like program is installed,so the dialog based frontend cannot be used. at /usr/share/perl5/Debconf/FrontEnd/Dialog.pm line 76.)
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: 8
这会暂停构建过程,即使我输入8
并按ENTER
,也不会发生任何事情。
似乎奇异性没有为普通的命令行输入提供适当的“漏洞”。我该如何解决?
解决方法
显然,这是经验丰富的Docker / Singularity用户中的一个众所周知的问题。事实证明,我可以通过在%post
脚本的开头进行设置来解决此问题:
export DEBIAN_FRONTEND=noninteractive
并以:
结尾unset DEBIAN_FRONTEND
我不确定tzdata
最终是如何配置的,但是在这种情况下,这对我而言并不那么重要。
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。