mirror of
https://github.com/felt/tippecanoe.git
synced 2026-10-03 00:45:41 +02:00
* Replace build-essential in Docker builder image build-essential is overkill, it pulls in all of the tools one needs to make to build debian packages, which we are not doing. Even though this is a builder image, it still takes time to download all the extra crud. Replace build-essential with make gcc and g++, which are all that are needed. * Replace dev packages in final Docker image The dev packages are only needed in the builder image. They add header files and docs and things that are not needed in the final image. Removing them and replacing them with just the runtime libraries reduces the final image size by about 25% (160M->124M) in a local build. Additionally, just for simplicity, zlib1g is already part of base ubuntu minimal, so we don't even have to list it. * Remove build-essential mention from the README Just like the in Dockerfile, people don't need all of those packages to build directly on their system.
21 lines
588 B
Docker
21 lines
588 B
Docker
FROM ubuntu:22.04 AS tippecanoe-builder
|
|
|
|
RUN apt-get update \
|
|
&& apt-get -y install make gcc g++ libsqlite3-dev zlib1g-dev
|
|
|
|
COPY . /tmp/tippecanoe-src
|
|
WORKDIR /tmp/tippecanoe-src
|
|
|
|
RUN make
|
|
|
|
CMD make test
|
|
|
|
# Using multistage build reduces the docker image size by alot by only copying the needed binaries
|
|
FROM ubuntu:22.04
|
|
RUN apt-get update \
|
|
&& apt-get -y install libsqlite3-0 \
|
|
&& rm -rf /var/lib/apt/lists/*
|
|
COPY --from=tippecanoe-builder /tmp/tippecanoe-src/tippecanoe* /usr/local/bin/
|
|
COPY --from=tippecanoe-builder /tmp/tippecanoe-src/tile-join /usr/local/bin/
|
|
WORKDIR /app
|