Skip to content

singularityhub/singularity-in-docker

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Singularity in Docker

This is a proof of concept for packaging a Singularity container in a Docker image, only with purpose to store it in a Docker Registry for pulling later. Of course you'd need Docker or a tool like oras to handle the pull. Use at your own risk! I don't know if there are rules against this sort of thing.

img/poopies.png

Build

Build the Singularity container.

$ sudo singularity build busybox.sif Singularity

Then test it:

$ ./busybox.sif

then build the docker container, giving the Singularity container as a build arg.

$ docker build -t vanessa/singularity-in-docker --build-arg container=busybox.sif .

Make sure it's there:

$ docker run -it vanessa/singularity-in-docker 
/ # ls /
bin          dev          home         root         tmp          var
busybox.sif  etc          proc         sys          usr

Then push to wherever you like! When it's time to pull and use:

$ docker pull vanessa/singularity-in-docker

You can run with a different entrypoint, detached, to keep it running:

$ docker run -d --rm --name squiggles vanessa/singularity-in-docker tail -f /dev/null

Then copy the Singularity container:

$ docker cp squiggles:/busybox.sif exported-busybox.sif

Tada!

$ ./exported-busybox.sif 
Run run run run runnnnn!

And stop your squiggles.

$ docker stop squiggles

About

Use Docker as a shell to store a Singularity image

Resources

Code of conduct

Contributing

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published