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

Effective Docker builds #58

Open
novemberborn opened this issue Jun 28, 2015 · 0 comments
Open

Effective Docker builds #58

novemberborn opened this issue Jun 28, 2015 · 0 comments

Comments

@novemberborn
Copy link

I'd like to propose a talk on how best to build Docker images, with a focus of course on building Node applications.

This would cover:

  • using official base images
  • ordering your Dockerfile to reduce layers and improve build speed
  • managing .dockerignore with respect to local builds and CI
  • installing dependencies before copying other code
  • two-stage builds and slim images
  • using dev dependencies at build time but excluding them from the deployed image (and not just "removing" them in the next layer)
  • pinning versions (both base images as well as dependencies) so you don't have to worry when you have to update a rarely-changing service

All these are takeaways from deploying Node services at State.

As an example, the Node service powering the website has a rather complicated build process, with ~170 MiB worth of dependencies (including dev), JS & CSS compilation and even invocations of PhantomJS to generate critical path CSS. We can build this into an image that's only 207 MiB, which is about a 6th of the non-slim build.

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

No branches or pull requests

1 participant