4Science / dspace-docker

Docker images for dspace & dspace-cris (experimental)
BSD 3-Clause "New" or "Revised" License
6 stars 8 forks source link

Building of the Docker image takes a lot of time #6

Open olli-gold opened 6 years ago

olli-gold commented 6 years ago

Building the docker image obviously is a very exhausting task, on my test systems it's needing about 30 minutes to build the Image including compilation of the source code.

I have an idea how to optimize that: DSpace compiles all of the modules by default, and so does the Docker Build process. In docker-compose.yml you can set, which modules you need (c.f. https://github.com/4Science/dspace-docker/blob/master/docker-compose.yml#L31), but this setting is ignored at compilation time. The unwanted modules are deleted when the container is started instead.

So I propose not to compile the unwanted modules at all. You can exclude modules from compilation with the -P flag at the mvn command (e.g. mvn -e -U clean package -P \!dspace-xmlui,\!dspace-xmlui-mirage2). Would it make sense to use this option instead of the delete process in https://github.com/4Science/dspace-docker/blob/master/fs/usr/local/bin/start-dspace#L20?