-
Notifications
You must be signed in to change notification settings - Fork 23
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] Reduce the context to load at build time #441
base: master
Are you sure you want to change the base?
[docker] Reduce the context to load at build time #441
Conversation
@jeanpommier can we merge ? How to test ? |
I believe we can even make it more strict and exclude the web/target folder. Looking at the Dockerfile, the only source it is copying from right now is the docker/ folder. This is thus the only one that needs to be included in the context. Testing ? I'd say that if it builds, it should be fine. This is just about the files that are loaded in memory by docker when it build the image. By default, it copies the whole bunch of files lygin around rhe Dockerfile. Here, we reduce to what is useful only (the built war file, actually) |
Seems clear to me. |
Nope, don't. This PR is more than 1Y-old, I need to dedicate it a few minutes at least to check the docker image will still build. I really don't see what could go wrong, but you're never to careful |
What is the docker build process, BTW ? I can see one in the GH actions, but I can't see any reference/documented build process for the docker image, apart from that. Did I overlook something ? |
Wasn't there a maven target to build the docker image ? |
OK @pierrejego , you can merge, I builds, it runs. And it prevents you from loading more than 2Gb of context during the build process |
Just passing by. |
Hi, |
Load only folders that are used in the Dockerfile
bbf8a1b
to
318480a
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok.
But ideally you shouldn't be doing that if the Dockerfile was able to compile the application from the code directly. (not requiring to already compile it from outside of docker)
But that's another take...
agreed |
Using .dockerignore file allows to reduce drastically the context loading on the docker build (1,5G -> 200Mb)