seccomp-sandbox/build/Dockerfile.ubuntu

21 lines
712 B
Docker
Raw Normal View History

2023-11-20 21:15:49 +08:00
ARG REGISTRY=docker.io
2023-11-21 10:16:54 +08:00
ARG BASE=library/ubuntu:20.04
2023-11-20 21:15:49 +08:00
FROM ${REGISTRY}/${BASE} as base
FROM base as builder
2023-11-21 10:16:54 +08:00
RUN ln -svf /usr/share/zoneinfo/Asia/Shanghai /etc/localtime && apt update && apt install build-essential libseccomp-dev curl pkg-config -y
RUN curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | bash -s - -y
2023-11-20 21:15:49 +08:00
COPY . /src
WORKDIR /src
2023-11-21 10:16:54 +08:00
RUN /root/.cargo/bin/cargo build --release
2023-11-20 21:15:49 +08:00
FROM base as runtime
RUN apt update && apt install libseccomp2 -y && rm -rf /var/apt
2023-11-20 21:15:49 +08:00
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
2023-11-21 10:16:54 +08:00
CMD ["cp", "-v", "x2t-sandbox", "/data/x2t-sandbox"]
2023-11-20 21:15:49 +08:00