mirror of https://github.com/w4/bin.git
Build Docker container FROM scratch
This commit is contained in:
parent
7c0bb9f220
commit
c2678219d8
|
@ -1 +1,2 @@
|
|||
target
|
||||
Dockerfile
|
||||
|
|
|
@ -1,14 +1,14 @@
|
|||
FROM rust:1-slim-bookworm AS builder
|
||||
|
||||
RUN apt update && apt install -y libclang-dev
|
||||
FROM rust:1-alpine AS builder
|
||||
RUN apk add --no-cache musl-dev
|
||||
|
||||
COPY . /sources
|
||||
WORKDIR /sources
|
||||
RUN cargo build --release
|
||||
RUN chown nobody:nogroup /sources/target/release/bin
|
||||
|
||||
FROM gcr.io/distroless/cc-debian12
|
||||
FROM scratch
|
||||
COPY --from=builder /sources/target/release/bin /pastebin
|
||||
COPY --from=builder /etc/passwd /etc/passwd
|
||||
|
||||
USER nobody
|
||||
EXPOSE 8000
|
||||
|
|
Loading…
Reference in New Issue