mirror of
https://github.com/felt/tippecanoe.git
synced 2026-10-02 08:25:40 +02:00
Minor dockerfile optimizations (#240)
* 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.
This commit is contained in:
+2
-2
@@ -1,7 +1,7 @@
|
|||||||
FROM ubuntu:22.04 AS tippecanoe-builder
|
FROM ubuntu:22.04 AS tippecanoe-builder
|
||||||
|
|
||||||
RUN apt-get update \
|
RUN apt-get update \
|
||||||
&& apt-get -y install build-essential libsqlite3-dev zlib1g-dev
|
&& apt-get -y install make gcc g++ libsqlite3-dev zlib1g-dev
|
||||||
|
|
||||||
COPY . /tmp/tippecanoe-src
|
COPY . /tmp/tippecanoe-src
|
||||||
WORKDIR /tmp/tippecanoe-src
|
WORKDIR /tmp/tippecanoe-src
|
||||||
@@ -13,7 +13,7 @@ CMD make test
|
|||||||
# Using multistage build reduces the docker image size by alot by only copying the needed binaries
|
# Using multistage build reduces the docker image size by alot by only copying the needed binaries
|
||||||
FROM ubuntu:22.04
|
FROM ubuntu:22.04
|
||||||
RUN apt-get update \
|
RUN apt-get update \
|
||||||
&& apt-get -y install libsqlite3-dev zlib1g-dev \
|
&& apt-get -y install libsqlite3-0 \
|
||||||
&& rm -rf /var/lib/apt/lists/*
|
&& rm -rf /var/lib/apt/lists/*
|
||||||
COPY --from=tippecanoe-builder /tmp/tippecanoe-src/tippecanoe* /usr/local/bin/
|
COPY --from=tippecanoe-builder /tmp/tippecanoe-src/tippecanoe* /usr/local/bin/
|
||||||
COPY --from=tippecanoe-builder /tmp/tippecanoe-src/tile-join /usr/local/bin/
|
COPY --from=tippecanoe-builder /tmp/tippecanoe-src/tile-join /usr/local/bin/
|
||||||
|
|||||||
Reference in New Issue
Block a user