forked from hatoo/oha
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
28 lines (21 loc) · 772 Bytes
/
Dockerfile
File metadata and controls
28 lines (21 loc) · 772 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
ARG RUST_VERSION=slim
FROM docker.io/library/rust:${RUST_VERSION} AS chef
RUN cargo install cargo-chef --locked
RUN apt-get update && apt-get install -y \
cmake \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/*
WORKDIR /app
FROM chef AS planner
COPY . .
RUN cargo chef prepare --recipe-path recipe.json
FROM chef AS builder
COPY --from=planner /app/recipe.json recipe.json
RUN cargo chef cook --release --no-default-features --features rustls --recipe-path recipe.json
COPY . .
RUN cargo build --release --no-default-features --features rustls --bin oha
RUN strip /app/target/release/oha
FROM registry.fedoraproject.org/fedora-minimal AS runtime
USER 65535
COPY --chown=65535:65535 --from=builder /app/target/release/oha /bin/
ENTRYPOINT ["/bin/oha"]