DZone
Thanks for visiting DZone today,
Edit Profile
  • Manage Email Subscriptions
  • How to Post to DZone
  • Article Submission Guidelines
Sign Out View Profile
  • Post an Article
  • Manage My Drafts
Over 2 million developers have joined DZone.
Log In / Join
Refcards Trend Reports
Events Video Library
Refcards
Trend Reports

Events

View Events Video Library

Related

  • Solving the Mystery: Why Java RSS Grows in Docker on M1 Macs
  • Java Backend Development in the Era of Kubernetes and Docker
  • Java in a Container: Efficient Development and Deployment With Docker
  • A Beginner's Guide to Docker Compose

Trending

  • Agentic System Design in Practice: The Technical Debt in Enterprise Agentic Systems
  • Policy-as-Code for AI Systems: Enforcing Governance at the Infrastructure Layer
  • Multi-Agent Systems: Architecture Patterns for Developers
  • Federated MCP Control Plane: Policy-Aware Access to Multi-Backend Tool Servers
  1. DZone
  2. Software Design and Architecture
  3. Cloud Architecture
  4. Lightweight Docker Images for Java Apps

Lightweight Docker Images for Java Apps

If you're searching for a way to get your Docker images down to a more manageable size, it might just be easier to choose a different starting point.

By 
Kevin Hooke user avatar
Kevin Hooke
·
Updated Jun. 20, 16 · Tutorial
Likes (3)
Comment
Save
Tweet
Share
5.1K Views

Join the DZone community and get the full member experience.

Join For Free

There are a number of posts (e.g. here) talking about the official Java Docker images being on the large side – in Docker terms. The standard images can be more than 600MB before you even build the image containing your app. That's… pretty big.

Suggestions are to use a smaller image as a starting point, like Alpine Linux. It looks like at some point the official Java images have been updated to include a number of Alpine based images, too.

Pulling down an OpenJDK 8 image, java:openjdk-8-jdk and then java:openjdk-8-alpine, there's a massive size difference between the size of the two:

If you're planning on running something lightweight like a Spring Boot app, it looks like the provided Alpine images are a good starting point.

app Docker (software) Java (programming language)

Opinions expressed by DZone contributors are their own.

Related

  • Solving the Mystery: Why Java RSS Grows in Docker on M1 Macs
  • Java Backend Development in the Era of Kubernetes and Docker
  • Java in a Container: Efficient Development and Deployment With Docker
  • A Beginner's Guide to Docker Compose

Partner Resources

×

Comments

The likes didn't load as expected. Please refresh the page and try again.

  • RSS
  • X
  • Facebook

ABOUT US

  • About DZone
  • Support and feedback
  • Community research

ADVERTISE

  • Advertise with DZone

CONTRIBUTE ON DZONE

  • Article Submission Guidelines
  • Become a Contributor
  • Core Program
  • Visit the Writers' Zone

LEGAL

  • Terms of Service
  • Privacy Policy

CONTACT US

  • 3343 Perimeter Hill Drive
  • Suite 215
  • Nashville, TN 37211
  • [email protected]

Let's be friends:

  • RSS
  • X
  • Facebook