I tried to build an apptainer image from the following definition file:
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
$@
But the build process prompts for entering the geographic area and then gets stuck.
Inspired from an answer here, adding
at the beginning of the %post section did the trick for me.
Final definition file: