Skip to content
serhij.zolotukhin edited this page Dec 7, 2025 · 1 revision
builder pattern
It was actually very common to have one Dockerfile to use for development
(which contained everything needed to build your application),
and a slimmed-down one to use for production,
which only contained your application and exactly what was needed to run it.

This has been referred to as the “builder pattern”.
Maintaining two Dockerfiles is not ideal.
Use multi-stage builds
  With multi-stage builds, you use multiple FROM statements in your Dockerfile.
  Each FROM instruction can use a different base,
  and each of them begins a new stage of the build.
  You can selectively copy artifacts from one stage to another,
  leaving behind everything you don’t want in the final image.
Dynamic Jenkins-Swarm Example
In this post we take this one step further by demonstrating how a Docker container can dynamically add itself as a client to the Jenkins server.

My side bar

Clone this wiki locally