-
Notifications
You must be signed in to change notification settings - Fork 21
/
Dockerfile
33 lines (23 loc) · 754 Bytes
/
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
32
33
FROM ubuntu:jammy AS builder
ARG PROFILE=release
RUN apt-get update \
&& apt-get -y install build-essential curl libssl-dev pkg-config \
&& rm -rf /var/lib/apt/lists/*
RUN curl https://sh.rustup.rs -sSf | sh -s -- -y
RUN /root/.cargo/bin/rustup update
COPY . /app
WORKDIR /app
RUN /root/.cargo/bin/cargo build --$PROFILE --package crunch
# ===== SECOND STAGE ======
FROM ubuntu:jammy
RUN apt-get update \
&& apt-get -y install ca-certificates \
&& rm -rf /var/lib/apt/lists/*
ARG PROFILE=release
COPY --from=builder /app/target/$PROFILE/crunch /usr/local/bin
RUN useradd -u 1000 -U -s /bin/sh crunch
USER crunch
ENV RUST_BACKTRACE 1
ENV RUST_LOG="info"
RUN /usr/local/bin/crunch --version
ENTRYPOINT [ "/usr/local/bin/crunch" ]