From 4d512b5003d293584c2cefbc5bfc0c92ce1c1b9f 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 | 12 +++++++++--- 2 files changed, 9 insertions(+), 4 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..d938b00 100644 --- a/Dockerfile +++ b/Dockerfile @@ -7,13 +7,19 @@ RUN apt-get update && \ apt-get install -y build-essential autoconf automake libtool pkg-config python3 # clone libpostal -RUN git clone https://github.com/openvenues/libpostal /code/libpostal +RUN git clone --depth=1 https://github.com/openvenues/libpostal /code/libpostal +RUN git checkout 1fe1f0af1f328487e7397560e1b45beb6200ed85 WORKDIR /code/libpostal # install libpostal +ARG TARGETARCH +ENV DESTDIR=/libpostal +ENV DATADIR=/usr/share/libpostal RUN ./bootstrap.sh && \ - ./configure --datadir=/usr/share/libpostal && \ - make && make check && DESTDIR=/libpostal make install && \ + # https://github.com/openvenues/libpostal/pull/632#issuecomment-1648303654 + ([ "$TARGETARCH" == "arm64" ] && ./configure --datadir="$DATADIR" --disable-sse2 || ./configure --datadir="$DATADIR") && \ + make -j4 && \ + make install && \ ldconfig # main image