-
Notifications
You must be signed in to change notification settings - Fork 2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Reduce container size using neurodocker-minify #4
Conversation
Todo: Install ANTs from source rather than through |
- Install ANTs from source rather than via neurodebian, enabling installation to specific directory and hence pruning of unused files. - Update README instructions based on first working experience with neurodocker-minify. - Tweaks to tests.sh to remove unwanted files.
That process does however seem to be wiping the environment variables set within the container recipe file... |
I'm sure Docker never envisioned 19GB "microservices" :) The minification will indeed wipe the environment variables, so those will have to be reset. Also it might make more sense to have two separate Dockerfiles -- one full Dockerfile to be used for minification that includes the entire FSL and ANTs installations, and a second Dockerfile that installs the minified versions of FSL and ANTs. |
Do you have an established recommendation for how to address this? I'd expected to go straight from minification to DockerHub upload; utilising a second Dockerfile just to set some environment variables seems clunky. Better to just write them explicitly to e.g.
How would you envision this working? Would it simply be the case that, after following the instructions currently being drafted in the README, the minified container would then be uploaded to DockerHub, and a second one-liner Dockerfile would be defined that simply downloads such? Or are you thinking of something different? |
I was thinking of having one Dockerfile with the full installations of ANTs, FSL, and MRtrix3. The file could be There would be a second Dockerfile, for example I can make a full example later today. |
@Lestropie - I wrote my ideas down in the branch https://github.com/MRtrix3/containers/tree/kaczmarj-minify Can you please take a look? The Dockerfiles there use multi-stage builds, and with BuildKit (which ships with Docker nowadays), those stages can be built in parallel. I have outlines that in the README of that branch. Those Dockerfiles aren't yet complete, but they're close. |
Add ACPCdetect installation
OK, there's some ideas in there I've not seen before, and your slim recipe is different to what I had been thinking, though yours potentially has greater overlap with MRtrix3/mrtrix3#2134. There might be a third option that merges ideas from both and provides a good solution for both. I suspect you've more experience with containers than I have, but I'll at least write down my thinking in full and we'll see if it makes sense. What I had initially intended was:
The problems with this solution are:
Now what I'm thinking instead is:
From what you've got there, there's definitely optimisations for the initial build that could be introduced as a standalone build optimisation changeset, but I think my latest idea of having the full container there as a template to pull is cleaner than tarballing the dependencies and then starting the container build from scratch post-minify. |
Piping the contents of file Dockerfile_base through stdin resulted in the COPY operation not properly locating file "acpcdetect_v2.0_LinuxCentOS6.7.tar.gz".
Update tag and upload instructions for newly created DockerHub organisation "mrtrix3".
Okay, I think I have a working version: @jdtournier: If you want to make a Docker account, I can then add you as a member of the DockerHub organisation. Being a free account, we only get up to three members, and I can't make the base repository private. |
OK, I've just created an account on DockerHub as |
CLosed in favour of #11. |
Tagging @kaczmarj.
Made a little bit of progress on this, but only in draft form for now.