geodynamics / vq

Virtual Quake is a boundary element code designed to investigate long term fault system behavior and interactions between faults through stress transfer.
Other
12 stars 24 forks source link

Added DockerFile for docker containerization #191

Closed johnmaxwilson closed 7 years ago

tjesser-ucdavis-edu commented 7 years ago

3: That doesn't sound like a good fix, tbh. Mixing different geographic versions (1.45 vs 1.48) is bound to cause difficult-to-find issues, and if this ends up as the build guidelines for Virtual Quake, a dependency like this will make it unfeasible to build anywhere else.

2: I was able to find various resources talking about this problem, but haven't had time to sort through them. Here are a few lot of links:

And some about shared volumes:

johnmaxwilson commented 7 years ago

New changes!

3: I've finally gotten cmake to identify the apt-get installed geographiclib, so that issue is now fixed. We no longer need the geographiclib source.

2: I'm now setting the uid and gid of the virtualquake user via an entrypoint script. For Linux users, the host uid and gid are passed as environment variables to the container through docker run; Docker for Mac seems to handle permissions between the container and the host file system differently, and they don't need to pass in the variables. For Linux: docker run --rm -v <full path to host directory>:/home/virtualquake/external_volume -e HOST_UID=$(id -u) -e HOST_GID=$(id -g) -it vq For Mac: docker run --rm -v <full path to host directory>:/home/virtualquake/external_volume -it vq The only issue that arose was that the entrypoint script is run as whatever user is last set in the Dockerfile, which means the container has to start up as root to have permission to change ids around. My solution was to end the entrypoint script with a su virtualquake. When the user actually gains control of the container terminal, they're doing so as virtualquake. Does this seem appropriate?

tjesser-ucdavis-edu commented 7 years ago

You seem to have included an unrelated commit, https://github.com/geodynamics/vq/pull/191/commits/1bd88115501b217861bd2f5dd392bfa63cbb7aaa, but other than that, looks good. If you know how to use the necessary git incantations, it would probably be worth fixing, otherwise it's up to you. I'll work on getting this onto dockerhub soon.

johnmaxwilson commented 7 years ago

Thanks for catching that. Removed that commit, and merging.