-
Notifications
You must be signed in to change notification settings - Fork 443
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
docker: introduce more layers for smaller images #1267
Comments
Actually dragging that information all the way from val dockerGroupFiles = settingKey[String => Int](
"Order file mappings. Lower order means the file would be a part of an earlier layer"
)
// ...
// Flat by default.
dockerGroupFiles := Function.const(0) And then in the user code (if required): dockerGroupFiles := {
case m if m.startsWith("lib/my.organization") => 1
case _ => 0
} and group the files by that. This is far easier to add and support, and more flexible.
That would be even harder to add than the rest, since we wouldn't be able to just Disclaimer: I don't actually use |
I was actually going to open this exact same issue when I saw that blog post on Reddit. I am going to attempt @nigredo-tori 's solution tomorrow. Only caveats that I have almost zero experience with sbt plugins and/or docker. So this is going to be interesting. |
Thanks @nigredo-tori for your input. I had similar intentions (#368) and this is the most flexible and less sbt magic heavy option I came up with as well. Thanks @CremboC for tackeling this 😎 You will make a lot of people very happy. |
Hi, I'm playing with implementing this feature. Could you clarify if this plugin enables to build applications |
for the impatient ones, there's already a plugin |
Hi, I'm aware of #1268 but wanted to implement it from the very beginning (for fun&learn). I'm already building layered images in my daily work and wanted to migrate convention that differs from suggested above. I have code ready just need some improvements to be presented in PR today. I think having more than one option to choose is good for codebase, right? |
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 😂 |
Expected behaviour
sbt docker:stage
could generate aDockerfile
with multiple layers: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 aDockerfile
with multiple layers:Information
https://phauer.com/2019/no-fat-jar-in-docker-image/
The text was updated successfully, but these errors were encountered: