openworm / OpenWorm

Repository for the main Dockerfile with the OpenWorm software stack and project-wide issues
http://openworm.org
MIT License
2.69k stars 212 forks source link

Allow docker containers to persist after exit #276

Closed mstachowsky closed 4 years ago

mstachowsky commented 6 years ago

Currently, when we run stop.sh the docker container is destroyed, including all simulation data. We can copy the data out of the container before running stop.sh, but we can't do things like modify the source code in the docker container and have it persist after stopping the container. It would be nice if we could keep a container running and re-enter it without having to stop.sh/delete it. Essentially, this would make the docker container the "install file" for openworm, and would work just like installing it from scratch.

pgleeson commented 4 years ago

There should be instructions now in the Readme to do this. Basically, if you don't call stop.sh, it will persist in the background and can be reentered using:

docker start openworm                 # Restarts the container
docker exec -it openworm /bin/bash    # Runs bash inside the container

To keep multiple runs of the simulation stack, you can just not use the name "openworm" for it when you run it, and start/stop/exec in individual containers with the long id generated each time it's run (use: docker ps)