I try to extend the pytorch docker image with my definition file nnunet.def
:
Bootstrap: docker
From: pytorch/pytorch:1.4-cuda10.1-cudnn7-runtime
%post
git clone https://github.com/NVIDIA/apex
cd apex
pip install -v --no-cache-dir ./
%runscript
echo "Running nnunet container..."
However, when I build this image (with sudo singularity build image.sif nnunet.def
) I get the an error saying pip is not found:
...
+ pip install -v --no-cache-dir ./
/.build-script-post: 6: /.build-script-post: pip: not found
FATAL: failed to execute %post proc: exit status 127
FATAL: While performing build: while running engine: while running /usr/local/libexec/singularity/bin/starter: exit status 255
Why?
What is even more surprising is that when I enter in a shell directly from this image:
singularity shell docker://pytorch/pytorch:1.4-cuda10.1-cudnn7-runtime
I have no problem using pip:
Singularity> pip freeze
asn1crypto==1.2.0
backcall==0.1.0
...
Why can't I use pip in the %post
section of my definition file?