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
|
target
|
||||||
|
Dockerfile
|
||||||
|
|
|
@ -1,14 +1,14 @@
|
||||||
FROM rust:1-slim-bookworm AS builder
|
FROM rust:1-alpine AS builder
|
||||||
|
RUN apk add --no-cache musl-dev
|
||||||
RUN apt update && apt install -y libclang-dev
|
|
||||||
|
|
||||||
COPY . /sources
|
COPY . /sources
|
||||||
WORKDIR /sources
|
WORKDIR /sources
|
||||||
RUN cargo build --release
|
RUN cargo build --release
|
||||||
RUN chown nobody:nogroup /sources/target/release/bin
|
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 /sources/target/release/bin /pastebin
|
||||||
|
COPY --from=builder /etc/passwd /etc/passwd
|
||||||
|
|
||||||
USER nobody
|
USER nobody
|
||||||
EXPOSE 8000
|
EXPOSE 8000
|
||||||
|
|
Loading…
Reference in New Issue