6 merge requests!368Update prace.md to document the change from qprace to qprod as the default...,!367Update prace.md to document the change from qprace to qprod as the default...,!366Update prace.md to document the change from qprace to qprod as the default...,!323extended-acls-storage-section,!196Master,!180Singularity
In this case, Image is downloaded from Docker Hub, extracted to a temporary directory and singularity interactive shell is invoked. This procedure can take a lot of time, especially for larger images.
## Creating Own Image From Docker Image
## Creating Own Image From Docker Image
Singularity containers can be in three different formats:
* read-only **squashfs** (default) - best for production
* writable **ext3** (--writable option)
* writable **(ch)root directory** (--sandbox option) - best for development
Squashfs and (ch)root directory image can be built from docker source directly on the cluster, no root privileges are needed. Creating native singularity image is strongly recommended due to the speed of launching the container.
WARNING: Building container as an unprivileged user. If you run this container as root
WARNING: it may be missing some functionality.
Building Singularity image...
Singularity container built: ubuntu.img
Cleaning up...
```
## Launching the Container
The interactive shell can be invoked by the **shell** command. This is useful for development purposes. To make changes inside the container permanent use **-w | --writable** option.
Singularity image can contain a runscript. This script is executed inside container after the **run** command is used. The runscript is mostly used to run an application for which is the container build, in the following example it is **fortune | cowsay** command.
```console
```
hrb33@hrb33-toshiba:/tmp$ssh hrb33@login4.salomon
hra0031@login4:~$ singularity run ubuntu.img
___________________
< Are you a turtle? >
-------------------
\ ^__^
\ (oo)\_______
(__)\ )\/\
||----w |
|| ||
```
_____ _
## Accessing /HOME and /SCRATCH Within Container
/ ____| | |
| (___ __ _| | ___ _ __ ___ ___ _ __
\___ \ / _` | |/ _ \| '_ ` _ \ / _ \| '_ \
____) | (_| | | (_) | | | | | | (_) | | | |
|_____/ \__,_|_|\___/|_| |_| |_|\___/|_| |_|
http://www.it4i.cz/?lang=en
By default, user home directory is mounted inside the container, therefore you can access your files directly. If you need access to **/SCRATCH** storage for your computation, this must by mounted be **-B | --bind** option.
!!!Warning
Be aware, that the mounted folder has to exist inside the container or the container image has to be writable!
Last login: Fri Feb 10 14:38:36 2017 from 10.0.131.12