Closed saroele closed 8 years ago
Ha, sometimes a lunch break is what you need. I simplified the entire Dockerfile by adding the notebooks directly in the build.
I have finalised the docker image and run scripts for the development environment. I think we should leave the release version unfinished for now. Everyone who will use this image is a developer now, and will first clone the github repo to get the run-docker-dev.sh script and start the docker.
One thing we still have to fix: where to put the data (.tmpo database, caches, ...) when using the docker image? I think the best way is to mount a second volume inside the docker with the data so it can get stored on the host. But, to find which folder you want to mount inside the docker, you would have to read the opengrid.cfg file. This is feasible, but will make the run-docker-dev.sh script a little bit heavier.
An other solution is to impose that the data folder is inside the opengrid root (where the docker-run-dev.sh lives). This is the folder that gets mounted, so we can access a /data folder there without an additional mount. By adding /data to the .gitignore, we can avoid that it gets pushed. Maybe this is currently the most elegant option: restricts the freedom where to put the data but is uniform for anyone and easy.
Any other thoughts?
The path that is in the opengrid.cfg is the path within the docker container, so I would put /data
in there as the path and declare that as a volume in the Dockerfile. A developer can then choose where the data is stored by choosing how the volume in /data
is used (see https://docs.docker.com/engine/userguide/containers/dockervolumes/)
@wouterh good idea, I have adapted both the release and the dev Dockerfiles.
What about the docker-run-dev.sh
and docker-run-release.sh
scripts. Will we mount a default folder ($PWD ?) to the /data
volume. Developers who want another folder to be mounted to /data
will then have to adapt their shell script or use the appropriate docker run command directly in their terminal?
Current version of the pull request will mount the ./data folder to the /data folder in the container. I also updated the instructions on the docker hub: https://hub.docker.com/u/opengrid/dashboard/
What about an environment variable? The script can check if it is set and otherwise use a default.
Hi all,
I tried to get the notebooks inside the docker container by default. I'm almost there, except that a tar command in my Dockerfile is not doing anything. When I run the command manually inside /bin/bash in the container, it works well and the files are in the right place.
I'm afraid I need a little help, maybe @wouterh can figure out what's wrong?
Thanks, Roel