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

Use multistage build to bring in pbf executable #263

Merged
merged 1 commit into from
Nov 2, 2021

Commits on Nov 1, 2021

  1. 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
    orangejulius committed Nov 1, 2021
    Configuration menu
    Copy the full SHA
    017ee51 View commit details
    Browse the repository at this point in the history