Scrivio Interview library
DesignAdvanced6 min read · updated 12 November 2026

Should your organisation standardise on buildpacks or Dockerfiles for 200 Java services? Compare them and make a recommendation.

Buildpacks give every service the same patched base image, a standard layout and an SBOM, and they let us rebase images onto a patched OS layer without rebuilding the application; Dockerfiles give each team full control but spread base image choice and security patching across 200 teams. For 200 Java services I would standardise the image build under platform ownership: buildpacks with a company-approved builder as the default, or a central base image with one shared Dockerfile template, with a documented exception path for services that need native libraries or other custom setup.

Why this question is asked

With 200 services, the image build is no longer a detail of each project; it is a fleet-wide security and maintenance surface. When a critical vulnerability lands in the base OS or the JRE, the question is how many days it takes until all 200 images are patched, and the answer depends almost entirely on this decision. Interviewers ask it to see whether we compare the options on the things that matter at scale rather than on taste. In this answer, we will look at what each option means at 200 services, compare patching, supply chain and flexibility, deal with the services that do not fit, and make a recommendation with a rollout plan.

1What Each Option Means at Scale

With Dockerfiles, each repository contains its own build recipe. Teams choose a base image, decide how to copy the jar, set the user, JVM flags and entrypoint. With 200 services, we will find perhaps 15 different base images, a mix of Java versions, some images running as root, and several copies of the same mistakes, because each team learned Docker separately.

With buildpacks, there is no recipe in the repository. The build runs mvn spring-boot:build-image or the pack CLI against a builder, and the builder, an image owned by whoever chose it, decides the base OS, the JRE, the memory settings, the user and the layout. All 200 services end up with the same structure, and changing that structure is a change to one builder rather than 200 pull requests.

2Comparing the Options

The comparison that matters at this scale is not convenience for one developer but what happens across the fleet over years.

Buildpacks or Dockerfiles for 200 services
ConcernBuildpacksDockerfiles per team
Base image consistencyone builder, same base everywhereeach team picks, drift is normal
OS patchingrebase onto patched run image, no rebuildedit, rebuild and test 200 repos
JRE patchingrebuild with updated buildereach team updates its FROM line
SBOM and layoutproduced automatically, standardonly if each team adds tooling
Custom needs (native libs, fonts)harder: custom buildpack or buildereasy: any RUN instruction
Team skills neededlowDocker knowledge in every team
Debugging the buildmore opaque, learn the lifecycletransparent, one file

3Patching and the Supply Chain

The strongest argument for buildpacks is patching. A buildpack image is built on top of a run image, the base OS layer, and the CNB specification allows rebasing: replacing that bottom layer with a patched version without running the build again, because the application layers on top are independent of it. pack rebase does this in seconds per image. When an OpenSSL fix lands in the base OS, the platform can rebase all 200 images, test and redeploy them, instead of waiting for 200 teams to edit and rebuild. A JRE fix still needs a rebuild, but it is the same automatic rebuild with an updated builder for everyone.

The second argument is supply chain. Paketo buildpacks write an SBOM (software bill of materials) for the JRE, the OS packages and the application dependencies into the image, and the layout is identical in every image, so scanners, signing and admission policies work the same way across the fleet. With Dockerfiles, all of this is possible, but every team has to add it, and in practice a share of them will not.

4Where Buildpacks Get Harder

Buildpacks are opinionated, and some services do not fit the opinion. A service that needs native libraries, for example an image library, a fonts package for PDF rendering, a database client or a hardware driver, needs packages that the default run image does not contain. With a Dockerfile, that is one RUN apt-get install line. With buildpacks, it means a custom builder or run image with those packages, or a custom buildpack, which is real work and needs someone who understands the lifecycle. Debugging a failing build is also less obvious than reading a Dockerfile.

In a fleet of 200 Java services, such cases are usually a small minority, maybe 5 to 10 percent. The decision should not be driven by them, but the standard must have a clear, supported path for them, or those teams will route around the platform.

5The Recommendation

I would standardise the image build under platform ownership, with buildpacks as the default. The platform team publishes a company builder, based on Paketo, with an approved run image, our CA certificates and default JVM settings, and versions it. Every service builds with mvn spring-boot:build-image pointing at that builder, so there is no image recipe in service repositories at all. OS patches are applied by rebasing; JRE patches by an automatic rebuild of all services triggered when the builder changes.

For the exceptions, the platform offers a central base image and one shared Dockerfile template, also owned by the platform: the team adds its packages in a small, reviewed section, and the template keeps the user, layout and entrypoint standard. If the organisation already has deep Docker skills and a strong central base image, the reverse choice is also reasonable: one shared Dockerfile template for everyone. What matters is that there is one owner for how images are built, not which tool is used. What I would not accept is 200 independent Dockerfiles.

Step throughChoosing the image path for a service
  1. Standard Java service?
    YesCompany builder via build-imageNoCheck special needs
  2. Needs OS packages or native libs?
    YesShared Dockerfile template with central baseNoCompany builder
  3. Platform reviews the exceptionadded to template or builder if common
  4. Same scanning, signing and SBOM checksfor both paths

4 steps in order. Play them, or step through them one at a time.

6Rolling It Out

We migrate in waves. First, five volunteer services move to the company builder, and we compare image size, start-up time and memory before and after; the memory calculator in particular should be checked against the old JVM flags. Then we move services in batches through automated pull requests that remove the Dockerfile and change the CI step, with a deadline set by the security team rather than by the platform team. We track the share of images built by an approved path as a metric, and once it passes 90 percent, the admission controller starts rejecting images from unknown bases, so the standard is enforced rather than only recommended.

7Follow-up questions

Does rebasing really avoid rebuilding the application?

Yes, for the OS layer. The application layers do not depend on the run image's contents in a way that requires recompiling, so the CNB lifecycle can swap the base layer and write a new image manifest. It does not cover the JRE, which is contributed by a buildpack and needs a rebuild. So OS patches are fast and JRE patches use the normal rebuild path.

Is a shared Dockerfile template not just as good?

It can be close, if it is centrally owned and teams cannot change the important parts. The weaknesses are that patches still need a rebuild of every service, SBOMs and layout depend on the template being kept current, and the template tends to be copied and edited. With strong ownership and automation, it is a valid standard.

What about Jib?

Jib builds layered images for Java applications without a Docker daemon and without a Dockerfile, using a base image we choose. It is a good fit for CI runners without Docker. As a fleet standard it shares the main property of buildpacks, a standard layout, but patching means rebuilding with a new base image, since it has no rebase step.

8Conclusion

In this answer, we compared buildpacks and Dockerfiles for 200 Java services. Buildpacks give consistent, patched base images, rebasing without rebuilds, SBOMs and a standard layout that helps supply-chain checks, while Dockerfiles give full control but spread base image choice and patching across every team, and custom needs such as native libraries are easier with them. We recommended platform-owned buildpacks with a company builder as the default, a central base image with a shared Dockerfile template for the exceptions, and a phased rollout ending in enforcement.

What to say in the interviewAbout 90 seconds aloud

Open with

At two hundred services I would decide based on patching and ownership, not developer taste. Buildpacks give every service the same base image, JRE handling, non-root user and layout, and they write an SBOM into every image, which makes scanning and signing uniform.

Then, if they want more

Their biggest advantage is rebasing: when the base OS is patched, the platform can swap the run image under all two hundred images in minutes without rebuilding the applications.

With a Dockerfile per team, we get full control and easy customisation, but also fifteen different base images, some running as root, and a patch means two hundred teams editing and rebuilding.

Where buildpacks are weaker is custom needs, like native libraries or extra OS packages, which need a custom builder or buildpack, and the build is less transparent to debug.

My recommendation is platform-owned image builds: a company builder based on Paketo as the default, used through spring-boot:build-image, and for the five to ten percent of services with special needs, a central base image with one shared Dockerfile template that the platform owns.

If the organisation already has a strong central base image and Docker skills, a single shared template for everyone is also acceptable. The non-negotiable part is one owner and one standard, enforced at deploy time once adoption is high.

About this answer

Last updated
12 November 2026
Checked
Its structure and format are checked automatically. Use it as a carefully prepared study note: where a detail matters, confirm it against the documentation below. What the checks cover
Where the question comes from
Written by Scrivio for practice. It is not taken from an interview.
Official documentation
Spring Boot reference
Report an issue with this answer

Copy the line below and send it to the author with what you found. It carries the address of this page.

Issue with "Should your organisation standardise on buildpacks or Dockerfiles for 200 Java services?...": https://scrivio-interview-library.netlify.app/spring-boot/packaging-and-deployment/089c1fc863/