-
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Dockerfile
60 lines (39 loc) · 1.06 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
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
FROM ubuntu:latest as builder
LABEL maintainer="Pouriya Jamshidi"
RUN DEBIAN_FRONTEND=noninteractive \
apt-get update \
&& apt-get install -y --no-install-recommends \
curl \
ca-certificates \
tar \
make \
build-essential \
&& rm -rf /var/lib/apt/lists/*
RUN curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y
ENV PATH="/root/.cargo/bin:${PATH}"
RUN cargo new --bin oxipot
WORKDIR /oxipot
COPY ./Cargo.lock ./Cargo.lock
COPY ./Cargo.toml ./Cargo.toml
COPY ./build.rs ./build.rs
RUN cargo build --release
RUN rm src/*.rs
RUN rm ./target/release/deps/oxipot*
COPY ./src/main.rs /oxipot/src/
COPY . /oxipot/
RUN cargo build --release
FROM ubuntu:latest
ARG TZ
ENV TZ ${TZ}
RUN DEBIAN_FRONTEND=noninteractive \
apt-get update \
&& apt-get install -y --no-install-recommends \
tzdata \
&& rm -rf /var/lib/apt/lists/*
ENV TZ="Europe/Brussels"
RUN mkdir -p /oxipot/db
WORKDIR /oxipot
COPY --from=builder /oxipot/target/release/oxipot /oxipot/
EXPOSE 2223
ENV RUST_LOG=info
CMD [ "/oxipot/oxipot"]