seccomp-sandbox/build/Dockerfile.static-build
2023-11-20 21:37:52 +08:00

21 lines
613 B
Docker

ARG REGISTRY=docker.io
ARG BUILDER_BASE=library/rust:alpine
ARG RUNTIME_BASE=library/alpine:latest
FROM ${REGISTRY}/${BUILDER_BASE} as builder
RUN apk add --no-cache pkgconf libseccomp-static libseccomp-dev musl-dev
COPY . /src
WORKDIR /src
RUN cargo build --release
FROM ${REGISTRY}/${RUNTIME_BASE} as base
FROM base as runtime
COPY --from=builder /src/target/release/x2t-sandbox /usr/local/bin/x2t-sandbox
FROM ${REGISTRY}/${RUNTIME_BASE} as copy-to-data
FROM base as copy-to-data
COPY --from=builder /src/target/release/x2t-sandbox /x2t-sandbox
CMD ["cp", "-v", "/x2t-sandbox", "/data/x2t-sandbox"]