-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
41 lines (34 loc) · 1.04 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
FROM rust:bookworm AS builder
ARG DEBIAN_FRONTEND=noninteractive
RUN apt-get update
RUN apt-get install -y --no-install-recommends \
build-essential \
protobuf-compiler \
llvm \
clang \
libclang-dev \
libssl-dev \
git-core \
pkg-config \
&& apt-get clean \
&& rm -rf /tmp/* /var/tmp/*
WORKDIR /builder
COPY . .
RUN --mount=type=cache,target=/usr/local/cargo/registry cargo build --release
FROM debian:bookworm-slim
ARG DEBIAN_FRONTEND=noninteractive
RUN apt-get update
RUN apt-get install -y --no-install-recommends \
libssl-dev iproute2 \
ca-certificates \
&& apt-get clean \
&& rm -rf /tmp/* /var/tmp/*
WORKDIR /app
COPY --from=builder /builder/rumqttd.toml /app/rumqttd.default.toml
COPY --from=builder /builder/target/release/dephy-edge .
COPY --from=builder /builder/target/release/dephy-edge-utils .
ENV RUST_LOG=dephy_edge=info,rumqttd::*=off
ENV MQTT_CONFIG_FILE=/app/rumqttd.default.toml
ENV HTTP_BIND_ADDRESS=[::]:3883
LABEL org.opencontainers.image.source https://github.com/dephy-io/dephy-edge
CMD /app/dephy-edge