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

21 lines
609 B
Docker

ARG REGISTRY=docker.io
ARG BASE=library/ubuntu:22.04
FROM ${REGISTRY}/${BASE} as base
FROM base as builder
RUN apt update && apt install build-essential libseccomp-dev -y
RUN curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
COPY . /src
WORKDIR /src
RUN cargo build --release
FROM base as runtime
RUN apt update && apt install libseccomp -y && rm -rf /var/apt
COPY --from=builder /src/target/release/x2t-sandbox /usr/local/bin/x2t-sandbox
FROM base as copy-to-data
COPY --from=builder /src/target/release/x2t-sandbox /x2t-sandbox
CMD ["cp", "-v", "/x2t-sandbox", "/data/x2t-sandbox"]