forked from mitre/hipcheck
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Containerfile
44 lines (31 loc) · 970 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
#============================================================================
# Builder Layer
FROM rust:1.79.0-slim-bookworm AS builder
WORKDIR /build
COPY .cargo/ .cargo/
COPY hipcheck-macros/ hipcheck-macros/
COPY hipcheck/ hipcheck/
COPY plugins/ plugins/
COPY xtask/ xtask/
COPY Cargo.toml Cargo.lock ./
RUN set -eux && \
apt-get update && \
apt-get install -y build-essential perl-base && \
cargo build --release
#============================================================================
# App Layer
FROM debian:bookworm-slim AS app
WORKDIR /app
COPY --from=builder /build/target/release/hc ./hc
COPY config/ config/
RUN set -eux && \
apt-get update && \
apt-get install -y npm git protobuf-compiler && \
apt-get clean && \
npm install -g module-deps@6.2 --no-audit --no-fund && \
adduser --disabled-password hc_user && \
chown -R hc_user /app
USER hc_user
ENV HC_CONFIG=./config
ENTRYPOINT ["./hc"]
CMD ["help"]