question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

docker: introduce more layers for smaller images

See original GitHub issue

Expected behaviour

sbt docker:stage could generate a Dockerfile with multiple layers:

  • one for the OS with JRE
  • one for the dependencies
  • one for the resources
  • one for the code

The idea is to generate layers that do not change frequently and to re-use them. For example, if we change just a line of code, only the last layer has to be pushed.

Actual behaviour

sbt docker:stage generate a Dockerfile with multiple layers:

  • one for the OS with JRE
  • one for all the application needs (dependencies, resources, code)

Information

https://phauer.com/2019/no-fat-jar-in-docker-image/

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:5
  • Comments:9 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
muuki88commented, Oct 24, 2019

Related issues and PRS

0reactions
muuki88commented, Feb 26, 2020

Sorry for the late reply 😃

but wanted to implement it from the very beginning (for fun&learn)

those are the best reasons 👍

I’m already building layered images in my daily work and wanted to migrate convention that differs from suggested above

Always happy to have different approaches. I’m not using docker for production at all. So a lot to learn for me as well 😄

I think having more than one option to choose is good for codebase, right?

Definitely 👍 I just wanted to point out all the various efforts as this has been a long standing issue with multiple attempts to fix and it’s a bit messy 😂

Read more comments on GitHub >

github_iconTop Results From Across the Web

3 simple tricks for smaller Docker images - Learnk8s
Learn how to make your container images smaller in size for a quicker ... Layers use space and the more layer you have,...
Read more >
Docker Image Size - How to Keep It Small? - phoenixNAP
A Docker image takes up more space with every layer you add to it. Therefore, the more layers you have, the more space...
Read more >
How to Improve Docker Image Size With Layers
There are two methods to make images smaller. One is quite brutal but easy and efficient. Second is more tedious but defiantly more...
Read more >
Multi-stage builds - Docker Documentation
Keeping your images small with multi-stage builds. ... Each RUN , COPY , and ADD instruction in the Dockerfile adds a layer to...
Read more >
5 easy-to-implement tricks to trim down your Docker image size
In doing so we learn more about how Docker builds images and how to use base ... Since each layer has a little...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found