Skip to content
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

Use your own custom images for image size optimisation #15721

Closed
oliviermbida opened this issue Sep 22, 2022 · 2 comments
Closed

Use your own custom images for image size optimisation #15721

oliviermbida opened this issue Sep 22, 2022 · 2 comments
Labels
area/build Relates to Dockerfiles or docker build command lifecycle/locked lifecycle/stale

Comments

@oliviermbida
Copy link

File: build/building/multi-stage.md
For multi-stage builds to be efficient you need to know what is inside your docker images including the official docker images.
The advantages of using multi-stage builds relies on docker's layering and if the images being layered themselves contain unused packages that advantage is wasted.
This point may be obvious to experts but no where is this emphasised.
There are also issues with these claims:

  • "Multi-stage builds are useful to anyone who has struggled to optimize Dockerfiles while keeping them easy to read and maintain."

  • "Multi-stage builds allow you to drastically reduce the size of your final image, without struggling to reduce the number of intermediate layers and files"

I wrote this to explain why these claims don't stand up to scrutiny

Docker's Best practices

In short , Multi-stage builds does not allow you to drastically reduce the size of your final image rather the sizes of the images you choose for your stages allows you that. Image size optimisation is reducing the size of the image itself not choosing another image.

@craig-osterhout craig-osterhout added the area/build Relates to Dockerfiles or docker build command label Sep 23, 2022
@docker-robott
Copy link
Collaborator

There hasn't been any activity on this issue for a long time.
If the problem is still relevant, mark the issue as fresh with a /remove-lifecycle stale comment.
If not, this issue will be closed in 14 days. This helps our maintainers focus on the active issues.

Prevent issues from auto-closing with a /lifecycle frozen comment.

/lifecycle stale

@docker-robott
Copy link
Collaborator

Closed issues are locked after 30 days of inactivity.
This helps our team focus on active issues.

If you have found a problem that seems similar to this, please open a new issue.

/lifecycle locked

@docker docker locked and limited conversation to collaborators Feb 18, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area/build Relates to Dockerfiles or docker build command lifecycle/locked lifecycle/stale
Projects
None yet
Development

No branches or pull requests

3 participants