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
Please enter at least three characters to search
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

The software you build is only as secure as the code that powers it. Learn how malicious code creeps into your software supply chain.

Apache Cassandra combines the benefits of major NoSQL databases to support data management needs not covered by traditional RDBMS vendors.

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

Modernize your data layer. Learn how to design cloud-native database architectures to meet the evolving demands of AI and GenAI workloads.

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
  • Docker Bake: A Modern Approach to Container Building

Trending

  • Simplifying Multi-LLM Integration With KubeMQ
  • Automating Data Pipelines: Generating PySpark and SQL Jobs With LLMs in Cloudera
  • Blue Skies Ahead: An AI Case Study on LLM Use for a Graph Theory Related Application
  • Distributed Consensus: Paxos vs. Raft and Modern Implementations
  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
  • Docker Bake: A Modern Approach to Container Building

Partner Resources

×

Comments
Oops! Something Went Wrong

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
  • support@dzone.com

Let's be friends:

Likes
There are no likes...yet! 👀
Be the first to like this post!
It looks like you're not logged in.
Sign in to see who liked this post!