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

Multi Stage Dockerfile #1416

Closed
wants to merge 1 commit into from
Closed

Conversation

rblaine95
Copy link

When I was playing around with the Docker image I noticed that the image was huge (4.6GB uncompressed, 1.9GB compressed).

I tested out building this with a Multi Stage Dockerfile (your ubuntu based image as the builder and mhart/alpine-node as the executor)

The final image size is:

  • Uncompressed:
    • 4.6GB (original)
    • 680MB (multi stage)
  • Compressed:
    • 1.9GB (original)
    • 190MB (multi stage)

Also, there's the added benefit of fewer CVE's

image

Let me know what you think

* Split the Docker image so that one, big, image does the building and then an alpine based image with node installed has the compiled binaries.
* This decreases the image from around 4.5GB (uncompressed) to around 680MB (uncompressed)
@rblaine95 rblaine95 closed this Nov 9, 2018
@rblaine95 rblaine95 deleted the multi-stage-alpine branch November 9, 2018 21:46
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.

1 participant