From f26e6471f45de3bdfba50976878b1cdbddf397fc Mon Sep 17 00:00:00 2001 From: macbre Date: Thu, 22 May 2025 17:50:15 +0100 Subject: [PATCH] Dockerfile: use the minideb as the base image Fetch non-musl binaries. This change will allow use to build multi-arch images for both x64 and aarch64. See #28 $ docker images REPOSITORY TAG IMAGE ID CREATED SIZE macbre/sphinx latest b1577b9eaa4b 2 minutes ago 337MB ghcr.io/macbre/sphinxsearch latest 1cff92fe61c1 3 days ago 796MB ghcr.io/macbre/sphinxsearch 3.8.1 c0e5be0c58bf 3 days ago 796MB --- Dockerfile | 24 ++++++++++++++---------- 1 file changed, 14 insertions(+), 10 deletions(-) diff --git a/Dockerfile b/Dockerfile index a357298..f076daa 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,26 +1,30 @@ # Dockerfile for Sphinx SE -# https://hub.docker.com/_/alpine/ -FROM --platform=linux/amd64 alpine:3.21 +# https://hub.docker.com/r/bitnami/minideb +FROM bitnami/minideb:bookworm # https://sphinxsearch.com/blog/ -ENV SPHINX_VERSION 3.8.1-d25e0bb +ENV SPHINX_VERSION=3.8.1-d25e0bb # install dependencies -RUN apk add --no-cache mariadb-connector-c-dev \ - postgresql-dev \ +RUN apt-get update \ + && apt-get install -y --no-install-recommends \ + libgomp1 \ + libmariadb3 libmariadb-dev \ + libpq-dev \ wget # set up and expose directories RUN mkdir -pv /opt/sphinx/logs /opt/sphinx/indexes VOLUME /opt/sphinx/indexes -# https://sphinxsearch.com/files/sphinx-3.8.1-d25e0bb-linux-amd64-musl.tar.gz -RUN wget http://sphinxsearch.com/files/sphinx-${SPHINX_VERSION}-linux-amd64-musl.tar.gz -O /tmp/sphinxsearch.tar.gz \ +# https://sphinxsearch.com/files/sphinx-3.8.1-d25e0bb-linux-amd64-musl.tar.gz - Alpine +# https://sphinxsearch.com/files/sphinx-3.8.1-d25e0bb-linux-amd64.tar.gz - Debian +RUN wget http://sphinxsearch.com/files/sphinx-${SPHINX_VERSION}-linux-amd64.tar.gz -O /tmp/sphinxsearch.tar.gz \ && cd /opt/sphinx && tar -xf /tmp/sphinxsearch.tar.gz \ && rm /tmp/sphinxsearch.tar.gz # point to sphinx binaries -ENV PATH "${PATH}:/opt/sphinx/sphinx-3.8.1/bin" +ENV PATH="${PATH}:/opt/sphinx/sphinx-3.8.1/bin" RUN indexer -v # redirect logs to stdout @@ -34,9 +38,9 @@ VOLUME /opt/sphinx/conf # allow custom config file to be passed ARG SPHINX_CONFIG_FILE=/opt/sphinx/conf/sphinx.conf -ENV SPHINX_CONFIG_FILE ${SPHINX_CONFIG_FILE} +ENV SPHINX_CONFIG_FILE=${SPHINX_CONFIG_FILE} # prepare a start script RUN echo "exec searchd --nodetach --config \${SPHINX_CONFIG_FILE}" > /opt/sphinx/start.sh -CMD sh /opt/sphinx/start.sh +CMD ["sh", "/opt/sphinx/start.sh"]