-
Notifications
You must be signed in to change notification settings - Fork 9
/
Copy pathDockerfile.debug
39 lines (26 loc) · 932 Bytes
/
Dockerfile.debug
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
32
33
34
35
36
37
38
39
FROM rust:1.74-bookworm as builder
ENV CARGO_NET_GIT_FETCH_WITH_CLI=true
WORKDIR /build/mongoproxy
COPY Cargo.* ./
COPY proxy/ ./proxy
COPY mongo-protocol/ ./mongo-protocol
COPY async-bson/ ./async-bson
RUN cargo build
FROM debian:bookworm
RUN apt-get update
RUN apt-get install -y sudo procps sysstat net-tools curl netcat-traditional iptables less
RUN apt-get install -y heaptrack
RUN apt-get install -y valgrind
RUN apt-get install -y rust-gdb
RUN apt-get install -y linux-perf
RUN apt-get install -y iptables
RUN update-alternatives --set iptables /usr/sbin/iptables-legacy
RUN adduser --uid 9999 --disabled-password --gecos '' mongoproxy
RUN adduser mongoproxy sudo
RUN echo '%sudo ALL=(ALL) NOPASSWD:ALL' >> /etc/sudoers
WORKDIR /mongoproxy
RUN chown mongoproxy:mongoproxy /mongoproxy
USER mongoproxy
COPY --from=builder /build/mongoproxy/target/debug/mongoproxy ./
COPY iptables-init.sh .
ENV MALLOC_ARENA_MAX 2