From 60602fd4de57e255e0d2ee4821ce7178430f5a57 Mon Sep 17 00:00:00 2001 From: Peter Johnson Date: Fri, 1 Dec 2023 13:45:52 +0100 Subject: [PATCH] feat(docker): multiarch build --- .github/workflows/push.yml | 1 - Dockerfile | 17 +++++++++++++---- 2 files changed, 13 insertions(+), 5 deletions(-) diff --git a/.github/workflows/push.yml b/.github/workflows/push.yml index 231c0b5..60702fc 100644 --- a/.github/workflows/push.yml +++ b/.github/workflows/push.yml @@ -9,6 +9,5 @@ jobs: env: DOCKER_USERNAME: ${{ secrets.DOCKER_USERNAME }} DOCKER_PASSWORD: ${{ secrets.DOCKER_PASSWORD }} - DOCKER_BUILD_PLATFORMS: classic run: | curl "https://raw.githubusercontent.com/pelias/ci-tools/master/build-docker-images.sh" | bash - diff --git a/Dockerfile b/Dockerfile index ae6dd7f..8120fbf 100644 --- a/Dockerfile +++ b/Dockerfile @@ -11,10 +11,19 @@ RUN git clone https://github.com/openvenues/libpostal /code/libpostal WORKDIR /code/libpostal # install libpostal -RUN ./bootstrap.sh && \ - ./configure --datadir=/usr/share/libpostal && \ - make && make check && DESTDIR=/libpostal make install && \ - ldconfig +RUN ./bootstrap.sh + +# https://github.com/openvenues/libpostal/pull/632#issuecomment-1648303654 +ARG TARGETARCH +RUN if [ "$TARGETARCH" = "arm64" ]; then \ + ./configure --datadir='/usr/share/libpostal' --disable-sse2; \ + else \ + ./configure --datadir='/usr/share/libpostal'; \ + fi + +RUN make -j4 +RUN DESTDIR=/libpostal make install +RUN ldconfig # main image FROM pelias/baseimage