MontrealCorpusTools / Montreal-Forced-Aligner

Command line utility for forced alignment using Kaldi
https://montrealcorpustools.github.io/Montreal-Forced-Aligner/
MIT License
1.27k stars 242 forks source link

Rearrange Dockerfile to halve size of Docker image #711

Closed G-Thor closed 9 months ago

G-Thor commented 9 months ago

Thanks for this great tool. I was using your MFA Docker images and noticed that they are quite large.

The step RUN chown -R mfauser /env effectively doubles the size of the image since it has its own layer and all the files in /env are different due to user privilege changes. This can be prevented by simply chaining the two operations; the installation of the dependencies and the user privilege changes.

This PR rearranges some steps in the Dockerfile and does these two operations in the same Docker image layer. This reduces the size of the image by about half.

Don't hesitate to modify this PR if there are any issues with it.

mmcauliffe commented 9 months ago

Thanks for this, lgtm!