Use docker multistage builds for R development and deployment setting
tl;dr: You cannot. In the way you ask, methinks. Maybe you can do it differently.
Longer version:
- Don't take this as a glib answer.
- I think it gets to the core of how we package source code
- from taking source code from source repos
- or taking binary aggreations, for example as
.deb
files - or taking binary meta-aggreations, here Docker layers
- You realize that there are Docker layers containing components
- If I read your request correctly, you desire "reversing" one layer
- i.e. get the RStudio part out of the RStudio docker
- I think you can't
- Fundamentally, the RStudio Docker container just unpacks the .deb they ship
- So you should reverse your whole stack
- Start fron r-ver or r-base, add your particular development needs
- Then add the RStudio .deb as we do in the RStudio container
- (Legalese: We have explicit permission to redistribute this, I doubt this is transitive)
Hope this helps. Fill in any blanks where I got my assumptions wrong.