我尝试从以下定义文件构建一个 apptainer 图像:
Bootstrap: docker
From: pytorch/pytorch:2.0.1-cuda11.7-cudnn8-devel
%files
./requirements.txt /src/requirements.txt
%post
apt -y update
apt -y install git libxml2-dev
%runscript
$@
但是构建过程提示输入地理区域,然后就卡住了。
受到此处答案的启发,添加
TZ=Europe/Berlin
ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone
在 %post 部分的开头为我解决了这个问题。
最终定义文件:
Bootstrap: docker
From: pytorch/pytorch:2.0.1-cuda11.7-cudnn8-devel
%files
./requirements.txt /src/requirements.txt
%post
TZ=Europe/Berlin
ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone
apt -y update
apt -y install git libxml2-dev
%runscript
$@