Skip to content

Commit

Permalink
Merge pull request #589 from boegel/apptainer_fixes
Browse files Browse the repository at this point in the history
improve commands for building Apptainer image from Docker container
  • Loading branch information
hajgato authored Nov 20, 2023
2 parents 9abedce + 419b1b8 commit 682ff78
Showing 1 changed file with 14 additions and 7 deletions.
21 changes: 14 additions & 7 deletions mkdocs/docs/HPC/apptainer.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,13 +55,20 @@ Due to the nature of `--fakeroot` option, we recommend to write your
Apptainer/Singularity image to a globally writable location, like
`/tmp`, or `/local` directories. Once the image is created, you should
move it to your desired destination. An example to make an
Apptainer/Singularity container:

<pre><code>$ <b>APPTAINER_CACHEDIR=/tmp/ \
APPTAINER_TMPDIR=/tmp/ \
apptainer build --fakeroot /tmp/tensorflow-21.10-tf1-py3.sif \
docker://nvcr.io/nvidia/tensorflow:21.10-tf1-py3</b>
</code></pre>
Apptainer/Singularity container image:

```shell
# avoid that Apptainer uses $HOME/.cache
export APPTAINER_CACHEDIR=/tmp/$USER/apptainer/cache
# instruct Apptainer to use temp dir on local filessytem
export APPTAINER_TMPDIR=/tmp/$USER/apptainer/tmpdir
# specified temp dir must exist, so create it
mkdir -p $APPTAINER_TMPDIR
# convert Docker container to Apptainer container image
apptainer build --fakeroot /tmp/$USER/tf.sif docker://nvcr.io/nvidia/tensorflow:21.10-tf1-py3
# mv container image to $VSC_SCRATCH
mv /tmp/$USER/tf.sif $VSC_SCRATCH/tf.sif
```

### Converting Docker images

Expand Down

0 comments on commit 682ff78

Please sign in to comment.