'Singularity: Fatal authentication error when pulling public image

I am new to Singularity and trying to get my first definition file to work. However, I am getting a fatal authentication error when trying to build the definition file, even though I am pulling a public image.

First of all, building without use of a definition file works fine:

$ singularity build test.sif docker://ubuntu
INFO:    Starting build...
Getting image source signatures
Copying blob 8527c5f86ecc skipped: already exists  
Copying config 6e885d46c0 done  
Writing manifest to image destination
Storing signatures
2022/04/29 13:59:40  info unpack layer: sha256:8527c5f86ecc162d68a9d38c8f4c6a6443158c67417e8bc2c3cea9f3868394eb
INFO:    Creating SIF file...
INFO:    Build complete: test.sif

However, now I try to do what I think is the same using a definition file called test.def:

Bootstrap: docker
From: ubuntu

and the output is:

$ sudo singularity build test.sif test.def 
INFO:    Starting build...
FATAL:   While performing build: conveyor failed to get: unable to retrieve auth token: invalid username/password: unauthorized: incorrect username or password

I have checked both my SINGULARITY_DOCKER_PASSWORD and SINGULARITY_DOCKER_USERNAME variables, and they are both empty:

$ echo $SINGULARITY_DOCKER_PASSWORD

$ echo $SINGULARITY_DOCKER_USERNAME

Why am I getting this error and what can I do to fix it?



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source