Subject: Singularity can't find basic programs

From: "N. Y." <[email-masked]>
Date: Sat, 5 Aug 2023 16:22:07 +0000

On guix (GNU Guix) 5aceacac65784bd2e1fd12304f965ae6026de49d, trying to
build a Singularity image, I get many "command not found" errors for the
programs id, install, zcat, and tar:

ning@bluecoral ~/repos/bento$ sudo singularity build bento.sif bento.def
Password:
Using container recipe deffile: bento.def
Sanitizing environment
/gnu/store/cg4mz2irhcjcmd6ngszc04prn6xqvlqj-singularity-2.6.1/libexec/singularity/functions:
line 34: id: command not found
/gnu/store/cg4mz2irhcjcmd6ngszc04prn6xqvlqj-singularity-2.6.1/libexec/singularity/functions:
line 34: id: command not found
/gnu/store/cg4mz2irhcjcmd6ngszc04prn6xqvlqj-singularity-2.6.1/libexec/singularity/bootstrap-scripts/pre.sh:
line 44: install: command not found
/gnu/store/cg4mz2irhcjcmd6ngszc04prn6xqvlqj-singularity-2.6.1/libexec/singularity/bootstrap-scripts/pre.sh:
line 45: install: command not found
/gnu/store/cg4mz2irhcjcmd6ngszc04prn6xqvlqj-singularity-2.6.1/libexec/singularity/bootstrap-scripts/pre.sh:
line 46: install: command not found
egrep: warning: egrep is obsolescent; using grep -E
/gnu/store/cg4mz2irhcjcmd6ngszc04prn6xqvlqj-singularity-2.6.1/libexec/singularity/functions:
line 34: id: command not found
Adding base Singularity environment to container
/gnu/store/cg4mz2irhcjcmd6ngszc04prn6xqvlqj-singularity-2.6.1/libexec/singularity/bootstrap-scripts/environment.sh:
line 45: zcat: command not found
/gnu/store/cg4mz2irhcjcmd6ngszc04prn6xqvlqj-singularity-2.6.1/libexec/singularity/bootstrap-scripts/environment.sh:
line 45: tar: command not found
Cleaning up...

In my system.scm, I have both the singularity package:

  ;; Packages installed system-wide.  Users can also install packages
  ;; under their own account: use 'guix search KEYWORD' to search
  ;; for packages and 'guix install PACKAGE' to install a package.
  (packages (append (map specification->package '("nss-certs" "ntfs-3g"
"singularity"))
                    %base-packages))

As well as the service:

  ;; Below is the list of system services.  To search for available
  ;; services, run 'guix system search KEYWORD' in a terminal.
  (services
   (append (list (service gnome-desktop-service-type)
                 (service cups-service-type
                   ; http://localhost:631
                   (cups-configuration (web-interface? #t)))
                 (service bluetooth-service-type)
                 (set-xorg-configuration
                  (xorg-configuration (keyboard-layout keyboard-layout)))
                 (service docker-service-type)
                 (service singularity-service-type))
           ;; This is the default list of services we
           ;; are appending to.
           %desktop-services))

p.s. I also cannot build images without sudo, but I do not know if this is
intended:

ning@bluecoral ~/repos/bento$ singularity build bento.sif bento.def
Using container recipe deffile: bento.def
ERROR: You must be the root user to build from a Singularity recipe file
Cleaning up...

Best regards,
Ning