Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/rmeli/containers

Docker and Singularity recipes
https://github.com/rmeli/containers

Last synced: 22 days ago
JSON representation

Docker and Singularity recipes

Awesome Lists containing this project

README

        

# Containers

[Docker](https://www.docker.com/) and [Singularity](https://sylabs.io/singularity/) recipes.

## Singularity

### Build

```bash
sudo singularity build .sif .def
```

or

```bash
sudo singularity build --notest .sif .def
```

The `--notest` flag is needed to prevent [Singularity](https://sylabs.io/singularity/) to run the tests, in case they need GPU support.

### Test

```bash
singularity test --nv .sif
```

### Run

#### Interactive

```bash
singularity shell --nv .sif
```

#### Application

```bash
singularity run --nv --app .sif []
```

## Docker

### Build

```bash
docker build -t .
```

It is possible to build a container from a specific file:

```bash
docker build -t -f .
```

### Save & Load

A [Docker](https://www.docker.com/) container can be saved

```
docker save -o ./.tar
```

and loaded on a differe host:

```
docker load -i ./.tar
```

### Run

#### Interactive

```
docker run --gpus all -ti /bin/bash
```

## Notes

### Singularity container from Docker container

[Singularity](https://sylabs.io/singularity/) images can be easily created from local Docker images as follows:
```bash
sudo singularity build .sif docker-daemon://
```

### `.dockerignore`

The `.dockerignore` file allows to ignore possible `*.tar` images (and other files) in the current directory, which would be included in the Docker context sent to the Docker deamon.

### Timenzone

Manual entry of the timezone is required when building containers. The following addition solves the issue:

```
ENV TZ=Europe/London
RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone
```

## Acknowledgement

The following people contributed code and/or knowledge not reported in the commit history:
* Irfan Alibay (@IAlibay)
* Sebastien Buchoux (@seb-buch)

Their contributions is akcnowledged also in definition files, where appropriate.