FROM
statement. Let's call this new Dockerfile Dokerfile.development
.Dockerfile.deployment
. So now I see the following options to create these two images:
Dokerfile.development
into my Dockerfile.deployment
, but use the r-base image in the FROM
statement. Drawback: I always need to keep multiple Dockerfiles up to date. If I add another image for testing, I have 3 Dockerfiles with 99% overlap. Another way is to first create a Dockerfile.deployment
with all requirements for the deployment. Then, the development image is built on top of the deployment image. Dockerfile.development
is more or less c/p the installation instructions in the Dockerfile for the RStudio image to add RStudio to the deployment image, but with the deplyoment image as base image. Drawback: I would not understand the code in my own Dockerfiles anymore.
Use multistage builds that make it easy to extract the built executables (or actually anything) from one image and use it into another one, without having to copy all the dependencies that were needed to build the executable. So my idea would be to extract the relevant files from the RStudio image into a new image that would be my deployment image.
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.
my narrow question is: Is there a (single) executable I could extract from the build RStudio image and put it on top of my deployment image?
my more open question is: How are people handling the situation where the development image is the deployment image plus some other tools that are available as standalone images and they want to avoid duplication as shown in the two first solutions under Candidate solutions.
A multistage build allows you to use multiple images to build a final product. In a multistage build, you have a single Dockerfile, but can define multiple images inside it to help build the final image.
Multistage builds let the developer automate the creation process of applications that require some amount of compilation. Developers can create versions that target different OS versions or any other process dependency, which is a big benefit of the approach.
To provide the network configuration for an application's network stack.
tl;dr: You cannot. In the way you ask, methinks. Maybe you can do it differently.
Longer version:
.deb
filesHope this helps. Fill in any blanks where I got my assumptions wrong.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With