docker: introduce more layers for smaller images
See original GitHub issueExpected 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
Issue Analytics
- State:
- Created 4 years ago
- Reactions:5
- Comments:9 (6 by maintainers)
Top 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 >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Related issues and PRS
Sorry for the late reply 😃
those are the best reasons 👍
Always happy to have different approaches. I’m not using docker for production at all. So a lot to learn for me as well 😄
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 😂