Singularity - Container for HPC, Science

Singularity 2.4 commands

see bottom of: Container in HPC

Singularity 2.6 commands

Ref: 2.6 doc at
sudo singularity build pgi_netcdf.img pg_netcdf.def
sudo singularity build myimg Singularity 
sudo singularity build --writable metabolic.sif Singularity 2>&1  | tee singularity_build.log

# assuming Singularity is the .def file

Note that singularitypro26-runtime rpm does not support the "build" subcommand

Singularity 3.0 commands

Singularity 3.0 is a new rewrite in GO, it is not backward compatibile with 2.x.
3.0 doc at

# read-only image
sudo singularity build ./ansys.sif ./Singularity

# sandbox would create writable directory
# cd /tmp (or other dir that is root writable)
sudo singularity build --sandbox ./ansys.sif ./Singularity  2>&1 | tee singularity_build.log

# pull has a centralized cache, but image still be written to `pwd` multiple times 
singularity pull shub://tin6150/r4eta    
singularity pull --name myR shub://tin6150/r4eta # store in pwd, 
singularity cache list -v

singularity exec myR 
singularity exec myR bash
singularity exec myR rstudio
singularity exec shub://tin6150/r4eta rstudio

# pull docker container, from github container repository
singularity pull  docker://
singularity shell docker://

singularity pull  docker://  
singularity shell docker://  # get bash prompt 
singularity run   docker://  # get R    prompt

singularity exec  docker://  Rscript ./drJin.R                    # R script in current working dir
singularity exec  docker://  Rscript /opt/gitrepo/r4eta/drJin.R   # R script inside container

Singularity image format

  1. .simg - single file image from Singularity Hub prior to 3.0
  2. .sif - singularity 3.0 single file image, not directly writable
  3. [DIR] - 3.x --sandbox ./DIRNAME, writable

[Doc URL:]
(cc) Tin Ho. See main page for copyright info.