Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(Dockerfile): Use multistage build to bring in
pbf
executable
The polylines Docker image is a bit of a large one currently, as it includes not just Node.js and a `node_modules` directory, but a full compiler toolchain, an install of the Go language, the dependencies of the `pbf` repository from https://github.com/missinglink/pbf, and the final `pbf` executable that comes from it. All told, this brought the total image size to a whopping 950MB uncompressed. This PR makes use of multi stage builds to run the compiling of the `pbf` executable in a separate container. After this, all the toolchain and dependencies needed can be thrown away, and only the small executable copied to the final image. Using `container-diff` it looks like the image size, uncompressed, after pelias/docker-baseimage#23 as well, will be only 322MB. That's a nice 600MB savings! Before pelias/docker-baseimage#23 the image size still drops to 500MB, still a healthy reduction. Replaces #262
- Loading branch information