mirror of
https://github.com/GermanAizek/mongodb-without-avx
synced 2024-08-30 17:32:17 +00:00
52 lines
1.4 KiB
Docker
52 lines
1.4 KiB
Docker
FROM debian:11 as build
|
|
|
|
RUN apt update -y && apt install -y build-essential \
|
|
libcurl4-openssl-dev \
|
|
liblzma-dev \
|
|
libssl-dev \
|
|
python-dev-is-python3 \
|
|
python3-pip \
|
|
curl \
|
|
&& rm -rf /var/lib/apt/lists/*
|
|
|
|
ARG MONGO_VERSION=6.2.1
|
|
|
|
RUN mkdir /src && \
|
|
curl -o /tmp/mongo.tar.gz -L "https://github.com/mongodb/mongo/archive/refs/tags/r${MONGO_VERSION}.tar.gz" && \
|
|
tar xaf /tmp/mongo.tar.gz --strip-components=1 -C /src && \
|
|
rm /tmp/mongo.tar.gz
|
|
|
|
WORKDIR /src
|
|
|
|
COPY ./o2_patch.diff /o2_patch.diff
|
|
RUN patch -p1 < /o2_patch.diff
|
|
|
|
ARG NUM_JOBS=
|
|
|
|
RUN export GIT_PYTHON_REFRESH=quiet && \
|
|
python3 -m pip install requirements_parser && \
|
|
python3 -m pip install -r etc/pip/compile-requirements.txt && \
|
|
if [ "${NUM_JOBS}" -gt 0 ]; then export JOBS_ARG="-j ${NUM_JOBS}"; fi && \
|
|
python3 buildscripts/scons.py install-servers MONGO_VERSION="${MONGO_VERSION}" --release --disable-warnings-as-errors ${JOBS_ARG} && \
|
|
mv build/install /install && \
|
|
strip --strip-debug /install/bin/mongod && \
|
|
strip --strip-debug /install/bin/mongos && \
|
|
rm -rf build
|
|
|
|
FROM debian:11
|
|
|
|
RUN apt update -y && \
|
|
apt install -y libcurl4 && \
|
|
apt-get clean \
|
|
&& rm -rf /var/lib/apt/lists/*
|
|
|
|
COPY --from=build /install/bin/mongo* /usr/local/bin/
|
|
|
|
RUN mkdir -p /data/db && \
|
|
chmod -R 750 /data && \
|
|
chown -R 999:999 /data
|
|
|
|
USER 999
|
|
|
|
ENTRYPOINT [ "/usr/local/bin/mongod" ]
|