-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathContainerfile
More file actions
36 lines (25 loc) · 736 Bytes
/
Copy pathContainerfile
File metadata and controls
36 lines (25 loc) · 736 Bytes
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
# ------------
# Build
# ------------
FROM rust:1-bullseye AS BUILD
WORKDIR /app
RUN apt-get update && apt-get install -y musl musl-tools
RUN rustup target add x86_64-unknown-linux-musl
RUN cargo init
COPY Cargo.toml .
COPY Cargo.lock .
RUN cargo build --release --target x86_64-unknown-linux-musl
COPY src/ src/
COPY tests/ tests/
RUN cargo build --release --target x86_64-unknown-linux-musl
# ------------
# Runner
# ------------
FROM alpine:latest AS RUNNER
RUN apk --no-cache add fish git httpie shadow
COPY --from=BUILD /app/target/x86_64-unknown-linux-musl/release/treq /usr/local/bin/treq
RUN chmod +x /usr/local/bin/treq
RUN adduser -D -u 1000 wizard
USER wizard
RUN chsh -s /usr/bin/fish wizard
WORKDIR /home/wizard