eWaterCycle / ewatercycle

Python package for running hydrological models
https://ewatercycle.readthedocs.io/en/latest/
Apache License 2.0
33 stars 5 forks source link

Using local images #294

Open Peter9192 opened 2 years ago

Peter9192 commented 2 years ago

Adding to this: If I'm working on a (new) model I would like to test it without having to upload my 'in between' work to dockerhub. Is there a way to build a docker image and singularity image without it being on the hub?

Originally posted by @RolfHut in https://github.com/eWaterCycle/ewatercycle/issues/292#issuecomment-1029866119

Peter9192 commented 2 years ago

@RolfHut you can build your docker images locally like so:

cd directory_with_dockerfile
docker build .

The docker image will now show in my list of docker images (docker images), e.g.

peter@laptop: ~/ewatercycle/genericDistributedModel$ docker images
python                         3.8        7684fd0fc298   6 days ago       885MB

Now I should already be able to use that with ewatercycle with container_engine set to docker.

If you want to build a singularity images from a local docker file, you can do it like so (with singularity > 3):

peter@laptop: ~/ewatercycle/genericDistributedModel$ singularity build testimg.sif docker-daemon://python:3.8
INFO:    Starting build...
Getting image source signatures
Copying blob 0b0f2f2f5279 done
Copying blob 6398d5cccd2c done
...
INFO:    Creating SIF file...
INFO:    Build complete: testimg.sif

Does this help?

RolfHut commented 2 years ago

for researchCloud I need Singularity (right?) So this means I will also need to install singularity on my local machine. Will try that.