Skip to content
Snippets Groups Projects
Commit a2a27bf8 authored by Michael Blaschek's avatar Michael Blaschek :bicyclist:
Browse files

Update HandsOn.md

parent ea073ce6
Branches
No related tags found
No related merge requests found
......@@ -311,4 +311,35 @@ singularity exec my_container.sif ls /data
log.txt
```
#### PATH
Of course it is possible to modify the `PATH` that is accessible from the container.
```bash
export SINGULARITYENV_PREPEND_PATH=/opt/important/bin
export SINGULARITYENV_APPEND_PATH=/opt/fallback/bin
export SINGULARITYENV_PATH=/only/bin
```
#### Clean Environment
Singularity by default exposes all environment variables from the host inside the container. Use the `--cleanenv` argument to prevent this:
```bash
singularity run --cleanenv <image.sif> <arg-1> <arg-2> ... <arg-N>
```
#### Setting Environment variables
One can define an environment variable within the container as follows:
```bash
export SINGULARITYENV_MYVAR=Overridden
```
With the above definition, `MYVAR` will have the value "Overridden".
### Inspect
One can sometimes learn a lot about the image by inspecting its definition file:
```bash
singularity inspect --deffile <image.sif>
```
The definition file is the recipe by which the image was made (see below). If the image was taken from Docker Hub then a definition file will not be available.
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment