FROM alpine:3.7 as builder RUN apk add --no-cache \ git \ cmake \ make \ g++ \ bison \ flex \ mariadb-dev \ expat-dev \ mariadb-client RUN mkdir /build && cd /build \ && git clone https://github.com/manticoresoftware/manticore.git \ && cd manticore \ && git checkout manticore-2.7.3 \ && mkdir -p build && cd build \ && cmake \ -D SPLIT_SYMBOLS=1 \ -D WITH_MYSQL=ON \ -D WITH_PGSQL=OFF \ -D WITH_RE2=ON \ -D WITH_STEMMER=ON \ -D DISABLE_TESTING=ON \ -D CMAKE_INSTALL_PREFIX=/usr \ -D CONFFILEDIR=/etc/sphinxsearch \ -D SPHINX_TAG=release .. \ && make -j4 searchd indexer indextool RUN mkdir /manticore && \ mv /build/manticore/build/src/indexer /manticore/indexer && \ mv /build/manticore/build/src/searchd /manticore/searchd && \ mv /build/manticore/build/src/indextool /manticore/indextool RUN /bin/rm -rf /build RUN apk del --purge \ git \ cmake \ make \ flex \ g++ \ bison \ mariadb-dev \ expat-dev \ mariadb-client #alpine-3-8 does not have mariadb-libs and mariadb-client-libs, so we need to stick with alpine <3.8 FROM alpine:3.7 RUN apk add --no-cache \ mariadb-libs \ mariadb-client-libs \ postgresql-libs \ expat COPY --from=builder /manticore/indexer /usr/bin/ COPY --from=builder /manticore/searchd /usr/bin/ COPY --from=builder /manticore/indextool /usr/bin/ CMD [ "/usr/bin/sh" ]