-
Notifications
You must be signed in to change notification settings - Fork 47
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
Enh/docker #238
Enh/docker #238
Conversation
An intermediate image is used to build Brayns. The delivered image only provides the result of the compilation and runtime libraries. New image size is 437MB! Build time is also improved because there is no need to cleanup the *build* image anymore.
"On my way" means that your are still working on it, on not ready for review yet? |
Dockerfile
Outdated
ENV LD_LIBRARY_PATH $LD_LIBRARY_PATH:${DIST_PATH}/lib | ||
ENV PATH $PATH:${DIST_PATH}/bin | ||
|
||
ENV LD_LIBRARY_PATH $LD_LIBRARY_PATH:/app/dist/lib |
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.
why not reusing DIST_PATH instead of hard-coding /app/dist/lib?
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.
I agree, just use DIST_PATH
.
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.
- You are right, it should not be hardcoded. I will make the required changes.
- Besides
ENV
andARG
are not available in other build stages. they must be redefined. - I think we should use
ARG
instead ofENV
asDIST_PATH
does not seem to be a required variable in the container. Anybody against?
@tristan0x looks great, I was planning on using multi step builds, but never got the time to do it. |
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.
@tristan0x Just use the dist var and we'll merge.
@favreau Regarding BraynViewer, it is still work in progress. |
Hello @rolandjitsu |
On my way to make
braynsViewer
works within containers, here is a small contribution to shrink both Docker image size and build time.Image size is now 437MB instead of >1GB
The patch leverages multi-stage builds, a feature released in Docker 17.05.
More information available in the official user guide