diff --git a/CHANGELOG.md b/CHANGELOG.md index 44de5c4e36c..ca94479e5ed 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,6 +10,7 @@ - FIXED: Run all unit tests in CI [#5248](https://github.com/Project-OSRM/osrm-backend/pull/5248) - FIXED: Fix installation of Mason CMake and 32 bit CI build [#6170](https://github.com/Project-OSRM/osrm-backend/pull/6170) - FIXED: Fixed Node docs generation check in CI. [#6058](https://github.com/Project-OSRM/osrm-backend/pull/6058) + - CHANGED: Docker build, enabled apt-get update/install caching in separate layer for build phase [#6175](https://github.com/Project-OSRM/osrm-backend/pull/6175) # 5.26.0 - Changes from 5.25.0 diff --git a/docker/Dockerfile b/docker/Dockerfile index e3d69e3b373..fe0ee31ca5c 100644 --- a/docker/Dockerfile +++ b/docker/Dockerfile @@ -2,14 +2,15 @@ FROM debian:bullseye-slim as builder ARG DOCKER_TAG ARG BUILD_CONCURRENCY RUN mkdir -p /src && mkdir -p /opt + +RUN apt-get update && \ + apt-get -y --no-install-recommends install cmake make git gcc g++ libbz2-dev libxml2-dev \ + libzip-dev libboost1.74-all-dev lua5.2 liblua5.2-dev libtbb-dev -o APT::Install-Suggests=0 -o APT::Install-Recommends=0 + COPY . /src WORKDIR /src -RUN NPROC=${BUILD_CONCURRENCY:-$(grep -c ^processor /proc/cpuinfo 2>/dev/null || 1)} && \ - apt-get update && \ - apt-get -y --no-install-recommends install cmake make git gcc g++ libbz2-dev libxml2-dev \ - libzip-dev libboost1.74-all-dev lua5.2 liblua5.2-dev libtbb-dev -o APT::Install-Suggests=0 -o APT::Install-Recommends=0 && \ - echo "Building OSRM ${DOCKER_TAG}" && \ +RUN NPROC=${BUILD_CONCURRENCY:-$(grep -c ^processor /proc/cpuinfo 2>/dev/null || 1)} echo "Building OSRM ${DOCKER_TAG}" && \ git show --format="%H" | head -n1 > /opt/OSRM_GITSHA && \ echo "Building OSRM gitsha $(cat /opt/OSRM_GITSHA)" && \ mkdir -p build && \ @@ -27,7 +28,6 @@ RUN NPROC=${BUILD_CONCURRENCY:-$(grep -c ^processor /proc/cpuinfo 2>/dev/null || strip /usr/local/bin/* && \ rm -rf /src /usr/local/lib/libosrm* - # Multistage build to reduce image size - https://docs.docker.com/engine/userguide/eng-image/multistage-build/#use-multi-stage-builds # Only the content below ends up in the image, this helps remove /src from the image (which is large) FROM debian:bullseye-slim as runstage