Ace8 is the modernization practice of AceMQ.24/7 support from AceMQ after go-live
Book an Assessment

Application containerization

Application containerization: package Java apps so they run the same everywhere.

Containerizing a Java application is easy to start and easy to do badly. The details are memory, configuration, health and shutdown.

The short answer

Application containerization packages an application and its runtime into an image that runs the same on a laptop, in CI and in production. For Java it means a current JDK, a small base image, JVM settings that respect container memory, external configuration and health checks. Ace8 containerizes after the Java upgrade, so the image is built on a supported runtime.

Sequence

Should you containerize before or after upgrading Java?

After, in most cases. Old runtimes handle container memory limits poorly, and an image built on an end-of-life JDK carries its vulnerabilities into every environment. Upgrade first (see Java upgrade), get tests passing, and then package. If the application sits on an app server such as WebLogic, the app server exit usually comes before the image, because you would otherwise package the server and its licence into every container.

Checklist

What has to change in a Java app to run well in a container?

AreaTypical problemWhat we do
MemoryJVM sized for the host, then killed by the container limitUse a container-aware JDK and set heap as a percentage of the limit, for example MaxRAMPercentage
ConfigurationProperties files baked into the imageRead from environment variables, config maps and secrets
State on diskUploads or temp files written locallyMove to object storage or a volume, or make them disposable
SessionsSticky sessions in server memoryExternal session store, or stateless design
LoggingLogs written to filesWrite to standard output and let the platform collect it
HealthNo way to tell ready from aliveAdd liveness and readiness endpoints
ShutdownRequests cut off when the pod stopsHandle SIGTERM and drain in-flight requests
SecurityRunning as root, full OS in the imageNon-root user, minimal base, scanned image

Build

How should the image be built?

Use a supported base such as a slim JRE or distroless image rather than a full JDK on a general OS. Build in stages, so build tools stay out of the final image. For Spring Boot, use layered jars so dependencies, which rarely change, sit in a cached layer apart from application code. Cloud Native Buildpacks and Jib build such images without a Dockerfile, and a hand-written Dockerfile is fine when you need control.

Pin base image versions, rebuild on a schedule to pick up patches, and scan every image in the pipeline.

Measure

What should you measure before and after?

Image size and startup time are the two figures that show whether the work was done well. The ranges below are typical and illustrative, not a result from our own runs. They vary with the application, the base image and the JDK.

MeasureNaive image (illustrative)Tuned image (illustrative)
Image sizeAround 400 to 600 MB, full JDK on a general OSAround 150 to 300 MB, slim JRE with layers
StartupTens of seconds for a large Spring appOften several seconds shorter with class data sharing and trimmed dependencies
Memory behaviorKilled on limit, unpredictableStable under a set limit

Scope

What is containerization, and what is it not?

Containerization is packaging. It does not make an application cloud-native by itself. A monolith in a container is still a monolith, with the same release and scaling limits. That is fine, and often the right first step. Splitting is a separate decision; see monolith to microservices.

The same applies to Kubernetes. Running containers on an orchestrator brings scheduling, networking and configuration questions of its own, covered under Kubernetes replatforming.

Tools

Can tools containerize an application for you?

Some. Assistants can draft Dockerfiles and flag problems like local file writes. Konveyor analyzes applications for container readiness. They give a starting point and miss the behavior that only shows under load, such as memory limits and shutdown. An engineer reviews the output and the application is load tested in the container before it ships. See AI-assisted modernization.

After

Who supports the containers after go-live?

Packaging is the easy half. Running it means patching base images, watching resource use and handling incidents. AceMQ supports the new stack 24/7 after go-live; see supported after migration. Before any of this, the modernization assessment tells you which applications are ready to be packaged, and which need work first. For the full service set, see application modernization services.

FAQ

Frequently asked.

Something else on your mind? Ask an engineer.

It packages an application with its runtime and dependencies into an image that runs the same way in any environment that supports containers.

Know the cost before anything moves.

A fixed-price assessment gives you the inventory, the risk score and a phased plan. Scope and cost are fixed before the migration starts.

Book a Fixed-Price Assessment

Get in touch

Talk to a modernization engineer

Tell us what you run today. An engineer, not a sales script, replies within one business day.

305-204-2607info@ace8.io

66 W. Flagler St. 9th Floor
Miami, FL 33130

What are you moving off? *

Fixed price. Scope and cost before any migration starts.