Skip to content

Commit

Permalink
example on how to build singularity container
Browse files Browse the repository at this point in the history
  • Loading branch information
eglerean committed Mar 18, 2024
1 parent 89dabef commit 85f5af3
Showing 1 changed file with 39 additions and 1 deletion.
40 changes: 39 additions & 1 deletion content/environments.md
Original file line number Diff line number Diff line change
Expand Up @@ -246,7 +246,45 @@ package repositories.
`````
``````

````{exercise} (optional) Containers-2: Explore two really useful Docker images

````{exercise} (optional) Containers-2: Installing the impossible.
When you are missing privileges for installing certain software tools, containers can come handy.
Here we build a Singularity/Apptainer container for installing `cowsay` and `lolcat` Linux programs.
1. Make sure you have apptainer installed:
```console
$ apptainer --version
```
2. Make sure you set the apptainer cache and temporary folders.
```console
$ mkdir ./cache/
$ mkdir ./temp/
$ export APPTAINER_CACHEDIR="./cache/"
$ export APPTAINER_TMPDIR="./temp/"
```
3. Build the container from the following definition file above.
```console
apptainer build cowsay.sif cowsay.def
```
4. Let's test the container by entering into it with a shell terminal
```console
$ apptainer shell cowsay.sif
```
5. We can verify the installation.
```console
$ cowsay "Hello world!"|lolcat
```
````



````{exercise} (optional) Containers-3: Explore two really useful Docker images
You can try the below if you have Docker installed. If you have
Singularity/Apptainer and not Docker, the goal of the exercise can be to run
the Docker containers through Singularity/Apptainer.
Expand Down

0 comments on commit 85f5af3

Please sign in to comment.