Skip to content
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

Easy method to shrink size of terra-jupyter-r #352

Open
sjfleming opened this issue Sep 10, 2022 · 0 comments
Open

Easy method to shrink size of terra-jupyter-r #352

sjfleming opened this issue Sep 10, 2022 · 0 comments

Comments

@sjfleming
Copy link

The following line in the terra-jupyter-r Dockerfile is a problem:

&& 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

&& chown -R $USER:users /usr/local/lib/R/site-library /home/jupyter

up above all the R installs... perhaps to line 111.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant