-
Notifications
You must be signed in to change notification settings - Fork 3
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
Revert using Docker Engine's squash functionality #113
Comments
@ronaldtse from the document, Could we consider to use multi-stage build instead ? |
@phuonghuynh yes we should use a multi-stage build. We want to base our image "off" the existing base ubuntu container, i.e. we only want to squash the layers we build on top of the base Ubuntu container. It was previously doable with our docker-squash image (https://github.com/riboseinc/docker-squash-container) but this may no longer be current. |
@ronaldtse we already use it, https://github.com/metanorma/metanorma-docker/blob/master/Dockerfile.ubuntu.in#L4 So I think we will add new make command to let user select with or without |
@phuonghuynh the reason I want to have 2 stages squash is so that people who already have ubuntu do not need to download the full container. Can we do this? |
Let me check |
So people who already pull Ubuntu stage do not need to pull it again, docker client will only need to pull the cli stage? |
@phuonghuynh correct! |
Ping @phuonghuynh |
Yes, I am on it |
@ronaldtse as far as I understand this isn't valid anymore, because we don't squash images, right? |
The best practice approach now is to use multi-stage builds to just copy the necessary files. However this approach requires detailed testing. Perhaps we should try another base image like distroless? https://symflower.com/en/company/blog/2022/complete-guide-on-shrinking-container-images/ |
Actually I finished reading the article and it does not provide much info that we don't already know. I think if we have tebako, then there is a "pre-expanded" mode, that would be the best. Ping @maxirmx |
This topic confuses me a lot: tamatebako/tebako#74 (comment) |
I'm not sure if I'm suggesting the right thing. The issue here is that we have two ways of building a "package", as we have two deliverables: a tebako executable and a docker image. The way we build the docker image seems to contain some files we don't need. The way we build the tebako image seems more streamlined. There are pros and cons of both, but in any case we need both deliverables. If it is possible to streamline the build method of tebako to also generate a docker image, then it would simplify a lot our maintenance burden. |
Simply put, the base case is to just add the tebako executable in the docker image. Then we only build once and can calls create the docker image. But since the docker environment has less constraints (it has a r/w FS, it is allowed to have a much larger size), we could try to optimize the space/execution time requirements for the docker environment. |
I would suggest then that we
there will be single layer |
@maxirmx look forward to when we can do this... would you be able to help? |
Please note also that image efficiency is estimated at 98%. |
We only want to squash up to a certain layer to facilitate re-use of the base images, not squash all the way to the top.
The text was updated successfully, but these errors were encountered: