Skip to content

Add initial "Multi-stage Builds" section #6

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

Merged
merged 1 commit into from
Jun 13, 2019

Conversation

tianon
Copy link
Member

@tianon tianon commented Jun 12, 2019

See docker-library/official-images#5929 (this is the initial supporting documentation for that PR).

See docker-library/official-images#5929 (this is the initial supporting documentation for that PR).

- using [`jlink` from a JDK 9+ image](https://docs.oracle.com/javase/9/tools/jlink.htm) to create an image with a minimal JRE that contains only the necessary components for the contained application

It is also worth pointing out [moby/moby#37830 (no sticky bits)](https://github.com/moby/moby/issues/37830), [moby/moby#37123 (no ownership preservation until 19.03+)](https://github.com/moby/moby/issues/37123), and [moby/moby#36759 (no `ADD --from=xxx`)](https://github.com/moby/moby/issues/36759), so multi-stage builds are not currently supported/useful for "base" images like `ubuntu`.
Copy link
Member Author

Choose a reason for hiding this comment

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

I wasn't sure if it was worth pointing out moby/moby#38823 here too given that we don't use user namespaces on our builders currently -- thoughts?

@yosifkit
Copy link
Member

LGTM 🎉 🚀


Note to future self, you probably are looking for this: docker-library/official-images#5929 (comment)

The general idea is that if it can be reasonably done without multi-stage, it should be (long RUN lines or auto-excluding build dependencies is not a good enough excuse).

Slightly altered wording: If it can be done sensibly without a multi-stage Dockerfile, it should be.

@yosifkit yosifkit merged commit 45a8ff4 into docker-library:master Jun 13, 2019
@yosifkit yosifkit deleted the multistage branch June 13, 2019 23:26
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.

2 participants