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

Zones

Culture and Methodologies Agile Career Development Methodologies Team Management
Data Engineering AI/ML Big Data Data Databases IoT
Software Design and Architecture Cloud Architecture Containers Integration Microservices Performance Security
Coding Frameworks Java JavaScript Languages Tools
Testing, Deployment, and Maintenance Deployment DevOps and CI/CD Maintenance Monitoring and Observability Testing, Tools, and Frameworks
Culture and Methodologies
Agile Career Development Methodologies Team Management
Data Engineering
AI/ML Big Data Data Databases IoT
Software Design and Architecture
Cloud Architecture Containers Integration Microservices Performance Security
Coding
Frameworks Java JavaScript Languages Tools
Testing, Deployment, and Maintenance
Deployment DevOps and CI/CD Maintenance Monitoring and Observability Testing, Tools, and Frameworks

Generative AI has transformed nearly every industry. How can you leverage GenAI to improve your productivity and efficiency?

SBOMs are essential to circumventing software supply chain attacks, and they provide visibility into various software components.

Related

  • Bootstrapping Java Kubernetes Apps With Spring Initializr and K8s Initializer
  • Running a Java App With MySQL in Any Docker Environment
  • Automate Spring Boot App Deployment With GitLab CI and Docker
  • How to Identify the Underlying Causes of Connection Timeout Errors for MongoDB With Java

Trending

  • The Architecture That Keeps Netflix and Slack Always Online
  • The 7 Biggest Cloud Misconfigurations That Hackers Love (and How to Fix Them)
  • API Standards Are Data Standards
  • Testing Java Applications With WireMock and Spring Boot
  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
4.8K 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

  • Bootstrapping Java Kubernetes Apps With Spring Initializr and K8s Initializer
  • Running a Java App With MySQL in Any Docker Environment
  • Automate Spring Boot App Deployment With GitLab CI and Docker
  • How to Identify the Underlying Causes of Connection Timeout Errors for MongoDB With Java

Partner Resources

×

Comments

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

ABOUT US

  • About DZone
  • Support and feedback
  • Community research
  • Sitemap

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 100
  • Nashville, TN 37211
  • [email protected]

Let's be friends: