Skip to content

Raynooo/docker-to-singularity

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

What it does

Transforms a given Docker image into a Singularity one.

Setup required: env variables

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

Command-line

docker run <options> --privileged <image_name>

Config file

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"

Saving data

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>

Example

Environment file (ie: demo.env)

IMAGE_REPO=debian    
IMAGE_TAG=jessie     
SOFTWARE_NAME=debian-jessie     

Command line (supposing the image was built and called singularity)

docker run --env-file example.env --privileged -v /usr/local/test-output:/convertdir singularity

About

Docker recipe to create Singularity images from Docker images

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published