Closed orangejulius closed 2 years ago
Yeah very nice
Some quick notes:
pelias prepare polylines
pelias/baseimage
as the builder image for general consistency, and specifically to use a glibc-based environment. Alpine uses musl
and incompatibilities between it and glibc
can be real nasty.
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 thepbf
repository from https://github.com/missinglink/pbf, and the finalpbf
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 https://github.com/pelias/docker-baseimage/pull/23 as well, will be only 322MB. That's a nice 600MB savings!Before https://github.com/pelias/docker-baseimage/pull/23 the image size still drops to 500MB, also a healthy reduction.
Replaces https://github.com/pelias/polylines/pull/262