2

I have Singularity installed. In my repo I have Dockerfile. I want to create a SIF (Singularity Image) from that Dockerfile. I tried to look the docs and check the docker build option but it does not contain an option for Dockerfile. Is it possible to create a SIF image from Dockerfile? Something like:

Singularity build test.sif Dockerfile 
vesii
  • 2,760
  • 4
  • 25
  • 71
  • 1
    Does this answer your question? [how to build singularity container from dockerfile](https://stackoverflow.com/questions/60314664/how-to-build-singularity-container-from-dockerfile) – tsnowlan Apr 06 '21 at 13:32

1 Answers1

5

You cannot build a singularity image from a dockerfile. But you can build a docker image from the dockerfile and then convert that docker image to singularity format.

docker build -t myimg:latest .
sudo singularity build img.sif docker-daemon://myimg:latest
jkr
  • 17,119
  • 2
  • 42
  • 68