-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathDockerfile
31 lines (23 loc) · 1.07 KB
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
# Dockerfile for using mongo with a QEMU user binary
# Author: Steve Kerrison <git [at] stevekerrison.com>
# License: Unlicense
# Specify a different source tag if you want with --build-arg mongo_tag=...
ARG mongo_tag=7.0
# Mongo builds use Ubuntu Jammy, and its version of qemu is too old to emulate
# AVX. However, the binaries are static, so it doesn't matter if we pull them
# in from somewhere else. We'll use Debian slim
FROM debian:stable-slim AS qemu
RUN apt-get update \
&& apt-get -y install --no-install-recommends qemu-user-static
# Select the base image again
FROM mongo:${mongo_tag} AS mongo
# Used for running AVX(2) on incompatible systems. Ironically, surely even
# slower than just compiling without AVX(2)
COPY --from=qemu /usr/bin/qemu-x86_64-static /usr/bin/
# Rename mongo[ds]
RUN mv /usr/bin/mongod /usr/bin/mongod-native && \
mv /usr/bin/mongos /usr/bin/mongos-native
# Replace original paths with wrapper scripts that run with qemu
COPY mongod-qemu.sh /usr/bin/mongod
COPY mongos-qemu.sh /usr/bin/mongos
# Everything else in the mongo image remains the same