From 677b52468eb32d100c4e14459ba7ec33a9a909f1 Mon Sep 17 00:00:00 2001 From: Peter Becker Date: Wed, 3 Jun 2020 08:42:29 +0000 Subject: [PATCH 1/3] execute all make calls in parallel --- Dockerfile | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/Dockerfile b/Dockerfile index d3a2803..cf1009c 100644 --- a/Dockerfile +++ b/Dockerfile @@ -87,7 +87,9 @@ RUN wget https://download.osgeo.org/postgis/source/postgis-3.0.0.tar.gz -O postg && tar -xvzf postgis.tar.gz --strip 1 -C postgis_src \ && rm postgis.tar.gz \ && cd postgis_src \ - && ./configure && make && make install \ + && ./configure \ + && make -j $(nproc) \ + && make -j $(nproc) install \ && cd .. && rm -rf postgis_src # Set up renderer user @@ -103,7 +105,7 @@ RUN mkdir -p /home/renderer/src \ && cd build \ && cmake .. \ && make -j $(nproc) \ - && make install \ + && make -j $(nproc) install \ && mkdir /nodes \ && chown renderer:renderer /nodes \ && rm -rf /home/renderer/src/osm2pgsql From 0e1db364577e7072bad724661734ac01c09e4d8f Mon Sep 17 00:00:00 2001 From: Peter Becker Date: Wed, 3 Jun 2020 08:57:33 +0000 Subject: [PATCH 2/3] fix shallow fetch for osm2pgsql and mod-tile --- Dockerfile | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/Dockerfile b/Dockerfile index cf1009c..5b0af43 100644 --- a/Dockerfile +++ b/Dockerfile @@ -98,7 +98,7 @@ RUN adduser --disabled-password --gecos "" renderer # Install latest osm2pgsql RUN mkdir -p /home/renderer/src \ && cd /home/renderer/src \ - && git clone https://github.com/openstreetmap/osm2pgsql.git --depth 1 \ + && git clone -b master https://github.com/openstreetmap/osm2pgsql.git --depth 1 \ && cd /home/renderer/src/osm2pgsql \ && rm -rf .git \ && mkdir build \ @@ -113,8 +113,9 @@ RUN mkdir -p /home/renderer/src \ # Install mod_tile and renderd RUN mkdir -p /home/renderer/src \ && cd /home/renderer/src \ - && git clone -b switch2osm https://github.com/SomeoneElseOSM/mod_tile.git \ + && git clone -b switch2osm https://github.com/SomeoneElseOSM/mod_tile.git --depth 1 \ && cd mod_tile \ + && rm -rf .git \ && ./autogen.sh \ && ./configure \ && make -j $(nproc) \ From bcf2cfcadada1340b05e517e1f629b642915837a Mon Sep 17 00:00:00 2001 From: Peter Becker Date: Wed, 3 Jun 2020 09:21:14 +0000 Subject: [PATCH 3/3] combine several apt install calls --- Dockerfile | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/Dockerfile b/Dockerfile index 5b0af43..0ffb6be 100644 --- a/Dockerfile +++ b/Dockerfile @@ -11,14 +11,11 @@ RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone # Install dependencies RUN apt-get update \ - && apt-get install wget gnupg2 lsb-core -y \ + && apt-get install -y wget gnupg2 lsb-core apt-transport-https ca-certificates curl \ && wget --quiet -O - https://www.postgresql.org/media/keys/ACCC4CF8.asc | apt-key add - \ && echo "deb [ trusted=yes ] https://apt.postgresql.org/pub/repos/apt/ `lsb_release -cs`-pgdg main" | tee /etc/apt/sources.list.d/pgdg.list \ - && apt-get update \ - && apt-get install -y apt-transport-https ca-certificates - -RUN apt-get install -y curl \ && wget --quiet -O - https://deb.nodesource.com/setup_10.x | bash - \ + && apt-get update \ && apt-get install -y nodejs RUN apt-get install -y --no-install-recommends \