Compile time volume binding


#1

Hi,

I would like to know if there is a way to have some “volume binding” (should we say) at compile time?
This, in order to have some cache on artifacts. Eg. with maven in order not to re-download every common package between builds… In this case a .m2 folder could be mounted/shared/bind in order to use already download packages by the previous build.
This may also be usefull with other artifacts/dependencies manager like pip/npm… all dependencies systems with cached artifacts.

This may greatly reduced compilation time and bandwidth during builds.

Thank you for your amazing work all! :slight_smile:


#2

You should be able to take advantage of HAB_DOCKER_OPTS environment var.

$ HAB_DOCKER_OPTS="-v /path/to/m2:~/.m2" hab build
# or 
HAB_DOCKER_OPTS="-v /path/to/m2:~/.m2" hab studio enter

#3

@bdangit This implies using habitat in a docker environment, which is not needed with linux :wink:


#4

@jlebloas I’m not sure if there’s an easy way to do this with non-Docker Studios right now. @fnichol will know for sure, though.