-
Notifications
You must be signed in to change notification settings - Fork 33
Description
The following line in the terra-jupyter-r Dockerfile is a problem:
terra-docker/terra-jupyter-r/Dockerfile
Line 177 in e975475
| && chown -R $USER:users /usr/local/lib/R/site-library /home/jupyter |
The chown operation itself is fine, but since it occurs at the end of the build, it actually copies the whole layer with all the R installs over again. This ends up being several GB.
For example, on a machine that has built terra-jupyter-r, try running docker history terra-jupyter-r and you will likely see something like
IMAGE CREATED CREATED BY SIZE COMMENT
47c09bb5034d 42 minutes ago /bin/sh -c #(nop) USER jupyter 0B
754d26234c45 42 minutes ago |1 NCPU=16 /bin/sh -c R -e 'IRkernel::instal… 3.76GB
...
250ffdaacc93 42 minutes ago |1 NCPU=16 /bin/sh -c R -e 'BiocManager::ins… 3.76GB
...
Changing the permissions on /usr/local/lib/R/site-library after all the installs ends up copying all the massive layers that went into that folder (all the package installs).
Proposal:
Move the chown on line 177
terra-docker/terra-jupyter-r/Dockerfile
Line 177 in e975475
| && chown -R $USER:users /usr/local/lib/R/site-library /home/jupyter |
up above all the R installs... perhaps to line 111.