-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathContainerfile
46 lines (38 loc) · 940 Bytes
/
Containerfile
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
FROM rust:1.75
ARG UID=1000
RUN apt-get update \
&& apt-get install -y pkg-config \
libudev-dev \
pipx \
&& rm -rf /var/lib/apt/lists/*
RUN useradd -u ${UID} --create-home dev
USER dev
WORKDIR /usr/src/app
RUN pipx install pre-commit
ENV PATH="${PATH}:/home/dev/.local/bin"
COPY Cargo.* rust-toolchain.toml .
COPY .cargo/config.toml .cargo/config.toml
# HACK: only here so `cargo fetch` doesn't complain
COPY src/lib.rs src/lib.rs
COPY src/bin src/bin
RUN cargo fetch \
&& cargo install probe-rs --locked --features cli
LABEL SHELL="podman run \
-it \
--rm \
--name reset-ctrl-rust \
--userns keep-id \
--group-add keep-groups \
-v .:/usr/src/app:Z \
IMAGE"
LABEL SHELLEM="podman run \
-it \
--rm \
--name reset-ctrl-rust \
--userns keep-id \
--group-add keep-groups \
--security-opt label=type:embedded_container.process \
--device /dev/bus/usb \
-v .:/usr/src/app:Z \
IMAGE"
# trigger rebuild11