Transforms a given Docker image into a Singularity one.
Some environment variables must be set so the conversion script knows which image to transform and how to call the output:
- $IMAGE_REPO is the image's repository name
- $IMAGE_TAG is the image's tag
- $SOFTWARE_NAME is the name given to the image's software
docker run <options> --privileged <image_name>
To use your .env file simply add it to the command line this way:
docker run --env-file config.env ...
You can also set them at runtime without using the -e flag:
docker run -e "IMAGE_TAG=jessie" -e "IMAGE_REPO=debian"
The converted Singularity image is stored on the container's /convertdir mounted directory. This means that you should mount this volume on the host machine to keep the produced image.
This is shown below in the example using the -v argument:
docker run -v <host_absolute_path>:<container_path>
IMAGE_REPO=debian
IMAGE_TAG=jessie
SOFTWARE_NAME=debian-jessie
docker run --env-file example.env --privileged -v /usr/local/test-output:/convertdir singularity