-
Notifications
You must be signed in to change notification settings - Fork 56
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Johannes Kalmbach <[email protected]>
- Loading branch information
Showing
1 changed file
with
5 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,30 +1,28 @@ | ||
FROM ubuntu:22.04 as base | ||
ARG TARGETPLATFORM | ||
LABEL maintainer="Johannes Kalmbach <[email protected]>" | ||
ENV LANG C.UTF-8 | ||
ENV LC_ALL C.UTF-8 | ||
ENV LC_CTYPE C.UTF-8 | ||
ENV DEBIAN_FRONTEND=noninteractive | ||
RUN echo "Building for platform ->$TARGETPLATFORM<-" | ||
RUN if [ $TARGETPLATFORM = "linux/arm64" ] ; then echo "target is ARM"; else echo "target is not ARM, probably AMD64"; fi | ||
RUN apt-get update && apt-get install -y software-properties-common wget && add-apt-repository -y ppa:mhier/libboost-latest | ||
RUN wget https://apt.kitware.com/kitware-archive.sh && chmod +x kitware-archive.sh &&./kitware-archive.sh | ||
|
||
FROM base as builder | ||
ARG TARGETPLATFORM | ||
RUN if [ $TARGETPLATFORM = "linux/arm64" ] ; then echo "target is ARM"; else echo "target is not ARM, probably AMD64"; fi | ||
RUN apt-get update && apt-get install -y build-essential cmake libicu-dev tzdata pkg-config uuid-runtime uuid-dev git libjemalloc-dev ninja-build libzstd-dev libssl-dev libboost1.81-dev libboost-program-options1.81-dev libboost-iostreams1.81-dev libboost-url1.81-dev | ||
RUN if [ $TARGETPLATFORM = "linux/arm64" ] ; then echo "target is ARM"; else echo "target is not ARM, probably AMD64"; fi | ||
COPY . /app/ | ||
|
||
WORKDIR /app/ | ||
ENV DEBIAN_FRONTEND=noninteractive | ||
|
||
WORKDIR /app/build/ | ||
RUN cmake -DCMAKE_BUILD_TYPE=Release -DLOGLEVEL=INFO -DUSE_PARALLEL=true -D_NO_TIMING_TESTS=ON -GNinja .. | ||
RUN echo "Building for platform ->$TARGETPLATFORM<-" | ||
# When cross-compiling the container for ARM64, then compiling and running all tests runs into a timeout on GitHub actions, | ||
# so we disable tests for this platform. | ||
# TODO(joka921) reenable these tests as soon as we can use a native ARM64 platform to compile the docker container. | ||
RUN if [ $TARGETPLATFORM = "linux/arm64" ] ; then echo "target is ARM64, don't build tests to avoid timeout"; fi | ||
RUN if [ $TARGETPLATFORM = "linux/arm64" ] ; then cmake --build . --target IndexBuilderMain ServerMain; else cmake --build . ; fi | ||
RUN ctest --rerun-failed --output-on-failure | ||
RUN if [ $TARGETPLATFORM = "linux/arm64" ] ; then ctest --rerun-failed --output-on-failure ; fi | ||
|
||
FROM base as runtime | ||
WORKDIR /app | ||
|