Skip to content
This repository has been archived by the owner on Sep 30, 2024. It is now read-only.

Reduce container image size by using multi-stage builds #545

Merged
merged 2 commits into from
Jul 1, 2018

Conversation

rhoml
Copy link
Contributor

@rhoml rhoml commented Jul 1, 2018

fixes: #66

By using multi stage builds we can reduce the image size by 50%.

Regular build

<none>              <none>              cec3efb55b6d        8 minutes ago       60.6MB

After multi stage build

<none>              <none>              4ab2bafd0fc9        8 minutes ago       30.1MB

Copy link
Collaborator

@shlomi-noach shlomi-noach left a comment

Choose a reason for hiding this comment

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

Nice!
I've never seen the use of FROM twice in the same Dockerfile.

I see this is new in https://docs.docker.com/v17.09/engine/userguide/eng-image/multistage-build/#use-multi-stage-builds. Perhaps we should add comment specifying you'd need a 17.09 or later?

Unrelated, the existing Dockerfile is about to get a facelift. It is plain wrong: it pulls orchestrator from origin/master as opposed to running the very branch you're on. TODO.

@shlomi-noach shlomi-noach self-requested a review July 1, 2018 05:03
@shlomi-noach shlomi-noach self-assigned this Jul 1, 2018
@shlomi-noach shlomi-noach merged commit 07fb020 into openark:master Jul 1, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Smaller Docker Image
2 participants