Skip to content

Commit 662a8d0

Browse files
nurikknurikk
and
nurikk
authored
Split build command into two layers (Project-OSRM#6175)
* Split build command into two layers Co-authored-by: nurikk <[email protected]>
1 parent f2e2846 commit 662a8d0

File tree

2 files changed

+7
-6
lines changed

2 files changed

+7
-6
lines changed

CHANGELOG.md

+1
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
- FIXED: Run all unit tests in CI [#5248](https://github.com/Project-OSRM/osrm-backend/pull/5248)
1111
- FIXED: Fix installation of Mason CMake and 32 bit CI build [#6170](https://github.com/Project-OSRM/osrm-backend/pull/6170)
1212
- FIXED: Fixed Node docs generation check in CI. [#6058](https://github.com/Project-OSRM/osrm-backend/pull/6058)
13+
- 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)
1314

1415
# 5.26.0
1516
- Changes from 5.25.0

docker/Dockerfile

+6-6
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,15 @@ FROM debian:bullseye-slim as builder
22
ARG DOCKER_TAG
33
ARG BUILD_CONCURRENCY
44
RUN mkdir -p /src && mkdir -p /opt
5+
6+
RUN apt-get update && \
7+
apt-get -y --no-install-recommends install cmake make git gcc g++ libbz2-dev libxml2-dev \
8+
libzip-dev libboost1.74-all-dev lua5.2 liblua5.2-dev libtbb-dev -o APT::Install-Suggests=0 -o APT::Install-Recommends=0
9+
510
COPY . /src
611
WORKDIR /src
712

8-
RUN NPROC=${BUILD_CONCURRENCY:-$(grep -c ^processor /proc/cpuinfo 2>/dev/null || 1)} && \
9-
apt-get update && \
10-
apt-get -y --no-install-recommends install cmake make git gcc g++ libbz2-dev libxml2-dev \
11-
libzip-dev libboost1.74-all-dev lua5.2 liblua5.2-dev libtbb-dev -o APT::Install-Suggests=0 -o APT::Install-Recommends=0 && \
12-
echo "Building OSRM ${DOCKER_TAG}" && \
13+
RUN NPROC=${BUILD_CONCURRENCY:-$(grep -c ^processor /proc/cpuinfo 2>/dev/null || 1)} echo "Building OSRM ${DOCKER_TAG}" && \
1314
git show --format="%H" | head -n1 > /opt/OSRM_GITSHA && \
1415
echo "Building OSRM gitsha $(cat /opt/OSRM_GITSHA)" && \
1516
mkdir -p build && \
@@ -27,7 +28,6 @@ RUN NPROC=${BUILD_CONCURRENCY:-$(grep -c ^processor /proc/cpuinfo 2>/dev/null ||
2728
strip /usr/local/bin/* && \
2829
rm -rf /src /usr/local/lib/libosrm*
2930

30-
3131
# Multistage build to reduce image size - https://docs.docker.com/engine/userguide/eng-image/multistage-build/#use-multi-stage-builds
3232
# Only the content below ends up in the image, this helps remove /src from the image (which is large)
3333
FROM debian:bullseye-slim as runstage

0 commit comments

Comments
 (0)