Skip to content

Conversation

@florentx
Copy link
Contributor

Merging layers gives a big reduction of the image.

This is on top of:



# Install some deps, lessc and less-plugin-clean-css, and wkhtmltopdf
RUN /install/package_odoo.sh \
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We can save a few (although very small) layers with:

RUN --mount=type=bind,src=./base_requirements.txt,dst=/odoo/base-requirements.txt \
    --mount=type=bind,src=./extra-requirements.txt,dst=/odoo/extra-requirements.txt \

and so we don't need to COPY this files into the image, cause they're only used at build time

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Technically right.

But these files are small, and it might be useful to keep them in the image for troubleshooting: it is easier to have a hint of which package/version was actually installed when you connect to a container, if the requirement file is there.

@florentx florentx merged commit a344361 into master Jan 7, 2026
6 checks passed
@florentx florentx deleted the 19_reduce_size branch January 7, 2026 10:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants