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

Pharb/talk_build_nodejs_containers

Repository files navigation

No Docker Required: Building Node.js Container Images

While Docker is still most popular for packaging and running Node.js apps in containers, it has security and scalability shortcomings for production systems and build pipelines. Recently alternatives have emerged to build container images without Docker. Each of these address common problems: building without elevated privileges, reproducible results, caching of intermediate layers and scaling CI/CD in larger organizations.

We first introduce the basic structure of a container image and compare the build process for tools supporting Node.js. After demonstrating their usage, we give guidance for selecting the right tool – which might not always be Docker.

Examples

Here are some different ways to build the same Node.js example app with different tools.

Build Docker image using Docker daemon. Some best practises are applied and explained, but the build process might not be as secure as desired.

Use experimental BuildKit integration in Docker CLI version 19.03 to build Dockerfile.

Use Makisu to build Dockerfile within an unprivileged container for better isolation and security.

Exporting the resulting image would require setting up a separate remote image registry to push the image.

Let pack create a Docker image by using a matching Cloud Native Buildpack.

The Dockerfile is not used here.

Help and Support

This repository contains sample code which might be non-functional and not production-ready.

You can open a issue to ask for further help or explanations, but I might not have the time or knowledge to answer everything.

References

Docker

Open Container Initiative

Container Security

Node.js

BuildKit / docker buildx

buildah

kaniko

Makisu

Bazel

Cloud Native Buildpacks

License

This content of this repository is licensed under MIT.

About

Examples for Building Node.js Container Images

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published