-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathDockerfile
36 lines (25 loc) · 869 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
34
35
36
FROM rust:1.65 AS build
# Cache build
# https://dev.to/rogertorres/first-steps-with-docker-rust-30oi
WORKDIR /usr/share/bytebeam/mqttwrk
RUN cargo init --bin
COPY ./Cargo.toml .
RUN cargo build --release
# Actual build
COPY . /usr/share/bytebeam/mqttwrk
WORKDIR /usr/share/bytebeam/mqttwrk
RUN rm ./target/release/deps/mqttwrk*
RUN cargo build --release
# ---------------------------------------
FROM ubuntu:22.04
ENV LC_ALL=C.UTF-8
ENV LANG=C.UTF-8
RUN apt-get -y upgrade
RUN apt-get update
RUN DEBIAN_FRONTEND=noninteractive apt-get install -y sudo curl runit vim wget gnupg2 lsb-release python3-pip
COPY runit/ /etc/runit
RUN rm -rf /etc/runit/runsvdir
COPY --from=build /usr/share/bytebeam/mqttwrk /usr/share/bytebeam/mqttwrk
WORKDIR /usr/share/bytebeam/mqttwrk
RUN pip3 install --no-cache-dir -r requirements.txt
CMD ["/usr/bin/runsvdir", "/etc/runit"]