Singularity: Difference between revisions

From Leo's Notes
This page was last edited on 30 December 2021, at 01:35.
m Added categories and navbox
m Added HPC category
Line 44: Line 44:
{{Navbox Linux}}
{{Navbox Linux}}
[[Category:Linux]]
[[Category:Linux]]
[[Category:HPC]]
[[Category:LinuxUtilities]]
[[Category:LinuxUtilities]]

Revision as of 01:35, 30 December 2021


Singularity is a utility that can run containers without requiring any elevated privileges.

Cheat sheet

Description Command
Pulling images from docker hub singularity pull docker://gcc:7.2.0 (outputs gcc_7.2.0.sif)

singularity pull docker://gcc (outputs gcc_latest.sif)

Running a container ./gcc_latest.sif (which uses the container's runscript)

singularity run gcc_latest.sif

Exec a command instead of runscript singularity exec gcc_latest.sif echo hi

Tasks

Pulling docker images

singularity pull pulls from:

  • docker:// docker hub
  • shub:// Singularity hub

Images that are pulled will be saved as a .sif file. If a tag was provided, the tag will be part of the output filename.

Building singularity image from Dockerfile

You cannot build Dockerfiles in Singularity. You can however, build the Dockerfile with Docker as usual, then convert the local docker image into a singularity image file using singularity build while specifying the local docker-daemon as the source.

# docker pull quay.io/singularity/singularity
# docker run --rm -ti -v /tmp:/tmp quay.io/singularity/singularity build /tmp/output.sif docker-daemon://input:latest

See Also