Apptainer 构建卡在“地理区域”选择

问题描述 投票:0回答:1

我尝试从以下定义文件构建一个 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
    $@

但是构建过程提示输入地理区域,然后就卡住了。

apt singularity-container apptainer
1个回答
0
投票

受到此处答案的启发,添加

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
    $@
© www.soinside.com 2019 - 2024. All rights reserved.