Lorenz Walthert
Lorenz Walthert

Reputation: 4639

Use docker multistage builds for R development and deployment setting

Problem

Candidate solutions

So now I see the following options to create these two images:

I think the last option is preferred because it's the most modular solution and has the least duplication in the Dockerfiles and the lowest maintenance burden.

Question

Upvotes: 9

Views: 792

Answers (1)

Dirk is no longer here
Dirk is no longer here

Reputation: 368519

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.

Upvotes: 2

Related Questions