From 227040885e82bf0d57ae0424bbe64e1f6931418a Mon Sep 17 00:00:00 2001 From: Joe Wragg Date: Fri, 4 Oct 2024 11:07:07 +0100 Subject: [PATCH 1/7] change base image to get later version of gcc --- Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index 91f55fa..337a21d 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,4 @@ -FROM debian:bookworm-slim as builder +FROM debian:trixie-slim as builder LABEL maintainer=nils@gis-ops.com WORKDIR / From e99211f480888fb620b9f786f380fb90fa6ae0b7 Mon Sep 17 00:00:00 2001 From: Joe Wragg Date: Mon, 7 Oct 2024 15:43:22 +0100 Subject: [PATCH 2/7] remove daemon mode to see logs from docker --- tests/test.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/test.sh b/tests/test.sh index 742c3cb..bf07a87 100755 --- a/tests/test.sh +++ b/tests/test.sh @@ -22,7 +22,7 @@ cleanup() { sudo rm -r "${CONF_DIR}" } -docker run -d --name vroom -p ${PORT}:3000 -v ${CONF_DIR}:/conf $1 > /dev/null +docker run --name vroom -p ${PORT}:3000 -v ${CONF_DIR}:/conf $1 > /dev/null # wait for the server to start, plenty of time sleep 2 From ea448b31ada5849c01c870a5622f6d2096cbd2c4 Mon Sep 17 00:00:00 2001 From: Joe Wragg Date: Mon, 7 Oct 2024 16:03:03 +0100 Subject: [PATCH 3/7] force LF --- .gitattributes | 1 + 1 file changed, 1 insertion(+) create mode 100644 .gitattributes diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000..70a9d75 --- /dev/null +++ b/.gitattributes @@ -0,0 +1 @@ +* text eol=lf \ No newline at end of file From 426cb7013dc069c529682cc658ee9689e2210d4c Mon Sep 17 00:00:00 2001 From: Joe Wragg Date: Mon, 7 Oct 2024 16:53:40 +0100 Subject: [PATCH 4/7] use trixie-slim and install node --- Dockerfile | 43 +++++++++++++++++++++++-------------------- 1 file changed, 23 insertions(+), 20 deletions(-) diff --git a/Dockerfile b/Dockerfile index 337a21d..a9de5b2 100644 --- a/Dockerfile +++ b/Dockerfile @@ -7,27 +7,27 @@ RUN echo "Updating apt-get and installing dependencies..." && \ apt-get -y update > /dev/null && apt-get -y install > /dev/null \ git-core \ build-essential \ - g++ \ + g++ \ libssl-dev \ - libasio-dev \ + libasio-dev \ libglpk-dev \ - pkg-config + pkg-config ARG VROOM_EXPRESS_RELEASE=master # clone here, since the runner image doesn't have git installed RUN echo "Cloning and installing vroom-express release/branch ${VROOM_EXPRESS_RELEASE}..." && \ - git clone --branch $VROOM_EXPRESS_RELEASE --single-branch https://github.com/VROOM-Project/vroom-express.git + git clone --branch $VROOM_EXPRESS_RELEASE --single-branch https://github.com/VROOM-Project/vroom-express.git ARG VROOM_RELEASE=master RUN echo "Cloning and installing vroom release/branch ${VROOM_RELEASE}..." && \ - git clone --branch $VROOM_RELEASE --single-branch --recurse-submodules https://github.com/VROOM-Project/vroom.git && \ - cd vroom && \ - make -C /vroom/src -j$(nproc) + git clone --branch $VROOM_RELEASE --single-branch --recurse-submodules https://github.com/VROOM-Project/vroom.git && \ + cd vroom && \ + make -C /vroom/src -j$(nproc) -FROM node:20-bookworm-slim as runstage +FROM debian:trixie-slim as runstage COPY --from=builder /vroom-express/. /vroom-express COPY --from=builder /vroom/bin/vroom /usr/local/bin @@ -35,22 +35,25 @@ COPY --from=builder /vroom/bin/vroom /usr/local/bin WORKDIR /vroom-express RUN apt-get update > /dev/null && \ - apt-get install -y --no-install-recommends \ - libssl3 \ - curl \ - libglpk40 \ - > /dev/null && \ - rm -rf /var/lib/apt/lists/* && \ - # Install vroom-express - npm config set loglevel error && \ - npm install && \ - # To share the config.yml & access.log file with the host - mkdir /conf + apt-get install -y --no-install-recommends \ + libssl3 \ + curl \ + libglpk40 \ + > /dev/null && \ + curl -fsSL https://deb.nodesource.com/setup_20.x | bash - && \ + apt-get install -y nodejs npm && \ + npm install --global yarn && \ + rm -rf /var/lib/apt/lists/* && \ + # Install vroom-express + npm config set loglevel error && \ + npm install && \ + # To share the config.yml & access.log file with the host + mkdir /conf COPY ./docker-entrypoint.sh /docker-entrypoint.sh ENV VROOM_DOCKER=osrm \ - VROOM_LOG=/conf + VROOM_LOG=/conf HEALTHCHECK --start-period=10s CMD curl --fail -s http://localhost:3000/health || exit 1 From 1927aadd0b839d9e6b985c32f4ce8fabc79ccba5 Mon Sep 17 00:00:00 2001 From: Joe Wragg Date: Tue, 8 Oct 2024 09:06:28 +0100 Subject: [PATCH 5/7] intsall packages from trixie --- Dockerfile | 49 +++++++++++++++++++++++++------------------------ 1 file changed, 25 insertions(+), 24 deletions(-) diff --git a/Dockerfile b/Dockerfile index a9de5b2..3f73f4e 100644 --- a/Dockerfile +++ b/Dockerfile @@ -7,27 +7,27 @@ RUN echo "Updating apt-get and installing dependencies..." && \ apt-get -y update > /dev/null && apt-get -y install > /dev/null \ git-core \ build-essential \ - g++ \ + g++ \ libssl-dev \ - libasio-dev \ + libasio-dev \ libglpk-dev \ - pkg-config + pkg-config ARG VROOM_EXPRESS_RELEASE=master # clone here, since the runner image doesn't have git installed RUN echo "Cloning and installing vroom-express release/branch ${VROOM_EXPRESS_RELEASE}..." && \ - git clone --branch $VROOM_EXPRESS_RELEASE --single-branch https://github.com/VROOM-Project/vroom-express.git + git clone --branch $VROOM_EXPRESS_RELEASE --single-branch https://github.com/VROOM-Project/vroom-express.git ARG VROOM_RELEASE=master RUN echo "Cloning and installing vroom release/branch ${VROOM_RELEASE}..." && \ - git clone --branch $VROOM_RELEASE --single-branch --recurse-submodules https://github.com/VROOM-Project/vroom.git && \ - cd vroom && \ - make -C /vroom/src -j$(nproc) + git clone --branch $VROOM_RELEASE --single-branch --recurse-submodules https://github.com/VROOM-Project/vroom.git && \ + cd vroom && \ + make -C /vroom/src -j$(nproc) -FROM debian:trixie-slim as runstage +FROM node:20-bookworm-slim as runstage COPY --from=builder /vroom-express/. /vroom-express COPY --from=builder /vroom/bin/vroom /usr/local/bin @@ -35,25 +35,26 @@ COPY --from=builder /vroom/bin/vroom /usr/local/bin WORKDIR /vroom-express RUN apt-get update > /dev/null && \ - apt-get install -y --no-install-recommends \ - libssl3 \ - curl \ - libglpk40 \ - > /dev/null && \ - curl -fsSL https://deb.nodesource.com/setup_20.x | bash - && \ - apt-get install -y nodejs npm && \ - npm install --global yarn && \ - rm -rf /var/lib/apt/lists/* && \ - # Install vroom-express - npm config set loglevel error && \ - npm install && \ - # To share the config.yml & access.log file with the host - mkdir /conf - + apt-get install -y --no-install-recommends \ + libssl3 \ + curl \ + libglpk40 \ + > /dev/null && \ + rm -rf /var/lib/apt/lists/* && \ + # Install vroom-express + npm config set loglevel error && \ + npm install && \ + # To share the config.yml & access.log file with the host + mkdir /conf + +#Upgrade glibc +RUN echo "deb http://ftp.debian.org/debian trixie main" >> /etc/apt/sources.list && \ + apt-get update > /dev/null && \ + apt-get -t trixie install libc6 libc6-dev libc6-dbg libstdc++6 libgcc-s1 libzstd1 -y COPY ./docker-entrypoint.sh /docker-entrypoint.sh ENV VROOM_DOCKER=osrm \ - VROOM_LOG=/conf + VROOM_LOG=/conf HEALTHCHECK --start-period=10s CMD curl --fail -s http://localhost:3000/health || exit 1 From 69def8755b68d19324900a7a10db3f955d1556b0 Mon Sep 17 00:00:00 2001 From: Joe Wragg Date: Wed, 9 Oct 2024 08:40:46 +0100 Subject: [PATCH 6/7] Revert "remove daemon mode to see logs from docker" This reverts commit e99211f480888fb620b9f786f380fb90fa6ae0b7. --- tests/test.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/test.sh b/tests/test.sh index bf07a87..742c3cb 100755 --- a/tests/test.sh +++ b/tests/test.sh @@ -22,7 +22,7 @@ cleanup() { sudo rm -r "${CONF_DIR}" } -docker run --name vroom -p ${PORT}:3000 -v ${CONF_DIR}:/conf $1 > /dev/null +docker run -d --name vroom -p ${PORT}:3000 -v ${CONF_DIR}:/conf $1 > /dev/null # wait for the server to start, plenty of time sleep 2 From 8e7fc4cdddd01f7e13954916b7970caf0078a25d Mon Sep 17 00:00:00 2001 From: Joe Wragg Date: Thu, 10 Oct 2024 11:45:43 +0100 Subject: [PATCH 7/7] Revert "force LF" This reverts commit ea448b31ada5849c01c870a5622f6d2096cbd2c4. --- .gitattributes | 1 - 1 file changed, 1 deletion(-) delete mode 100644 .gitattributes diff --git a/.gitattributes b/.gitattributes deleted file mode 100644 index 70a9d75..0000000 --- a/.gitattributes +++ /dev/null @@ -1 +0,0 @@ -* text eol=lf \ No newline at end of file