Singularity: Difference between revisions
m Added categories and navbox |
|||
| (One intermediate revision by the same user not shown) | |||
| Line 29: | Line 29: | ||
===Building singularity image from Dockerfile=== | ===Building singularity image from Dockerfile=== | ||
You cannot build Dockerfiles in Singularity. | You cannot build Dockerfiles in Singularity. Instead, you will need to build the image using Docker and then convert it to a Singularity image. | ||
{{Highlight | |||
| code = # docker build -f Dockerfile-jupyter-plotly -t jupyter/scipy-notebook-plotly . | |||
# docker images | |||
REPOSITORY TAG IMAGE ID CREATED SIZE | |||
jupyter/scipy-notebook-plotly latest a8f13623a91f 8 minutes ago 3.21GB | |||
# singularity build /tmp/jupyter-plotly.sif docker-daemon://jupyter/scipy-notebook-plotly:latest | |||
| lang = terminal | |||
}} | |||
If you don't have Singularity installed, you can also use the Singularity docker image: | |||
{{Highlight | {{Highlight | ||
| code = # docker pull quay.io/singularity/singularity | | code = # docker pull quay.io/singularity/singularity | ||
# docker run --rm -ti -v /tmp:/tmp quay.io/singularity/singularity build /tmp/ | # docker run --rm -ti -v /tmp:/tmp quay.io/singularity/singularity \ | ||
build /tmp/jupyter-plotly.sif docker-daemon://jupyter/scipy-notebook-plotly:latest | |||
| lang = terminal | | lang = terminal | ||
}} | }}Once Singularity build completes, you should end up with a .sif singularity image. | ||
==See Also== | ==See Also== | ||
| Line 44: | Line 57: | ||
{{Navbox Linux}} | {{Navbox Linux}} | ||
[[Category:Linux]] | [[Category:Linux]] | ||
[[Category:HPC]] | |||
[[Category:LinuxUtilities]] | [[Category:LinuxUtilities]] | ||
Latest revision as of 23:23, 13 July 2022
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)
|
| Running a container | ./gcc_latest.sif (which uses the container's runscript)
|
| Exec a command instead of runscript | singularity exec gcc_latest.sif echo hi
|
Tasks
Pulling docker images
singularity pull pulls from:
docker://docker hubshub://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. Instead, you will need to build the image using Docker and then convert it to a Singularity image.
# docker build -f Dockerfile-jupyter-plotly -t jupyter/scipy-notebook-plotly .
# docker images
REPOSITORY TAG IMAGE ID CREATED SIZE
jupyter/scipy-notebook-plotly latest a8f13623a91f 8 minutes ago 3.21GB
# singularity build /tmp/jupyter-plotly.sif docker-daemon://jupyter/scipy-notebook-plotly:latest
If you don't have Singularity installed, you can also use the Singularity docker image:
# docker pull quay.io/singularity/singularity
# docker run --rm -ti -v /tmp:/tmp quay.io/singularity/singularity \
build /tmp/jupyter-plotly.sif docker-daemon://jupyter/scipy-notebook-plotly:latest
Once Singularity build completes, you should end up with a .sif singularity image.
See Also
- https://support.pawsey.org.au/documentation/display/US/Basics+of+Singularity
- https://oit.utk.edu/hpsc/isaac-open/singularity-user-guide