fix dockerfile for ubuntu
This commit is contained in:
parent
2b30c6181f
commit
533d69453e
@ -28,14 +28,14 @@ cargo build
|
|||||||
### Build static with container
|
### Build static with container
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
for link_type in static-build ubuntu-22.04; do
|
docker build -t x2t-sandbox-builder:copy-to-data -f build/Dockerfile.static --target copy-to-data .
|
||||||
docker build -t x2t-sandbox-builder:copy-to-data -f build/Dockerfile.$link_type --target copy-to-data .
|
docker run -it --rm -v /path/to/put/output/:/data x2t-sandbox-builder:copy-to-data
|
||||||
docker run -it --rm -v output/$link_type:/data x2t-sandbox-builder:copy-to-data
|
|
||||||
done
|
|
||||||
|
|
||||||
/output/path/x2t-sandbox --help
|
/output/path/x2t-sandbox --help
|
||||||
```
|
```
|
||||||
|
|
||||||
|
And there is [Dockerfile](./build/Dockerfile.ubuntu) for you to build for ubuntu. base image can be specified by argument `--build-arg BASE=library/ubuntu:22.04`. default base image is ubuntu:20.04
|
||||||
|
|
||||||
### Generate syscalls with strace
|
### Generate syscalls with strace
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
|
@ -1,14 +1,14 @@
|
|||||||
ARG REGISTRY=docker.io
|
ARG REGISTRY=docker.io
|
||||||
ARG BASE=library/ubuntu:22.04
|
ARG BASE=library/ubuntu:20.04
|
||||||
|
|
||||||
FROM ${REGISTRY}/${BASE} as base
|
FROM ${REGISTRY}/${BASE} as base
|
||||||
|
|
||||||
FROM base as builder
|
FROM base as builder
|
||||||
RUN apt update && apt install build-essential libseccomp-dev -y
|
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 | sh
|
RUN curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | bash -s - -y
|
||||||
COPY . /src
|
COPY . /src
|
||||||
WORKDIR /src
|
WORKDIR /src
|
||||||
RUN cargo build --release
|
RUN /root/.cargo/bin/cargo build --release
|
||||||
|
|
||||||
FROM base as runtime
|
FROM base as runtime
|
||||||
RUN apt update && apt install libseccomp -y && rm -rf /var/apt
|
RUN apt update && apt install libseccomp -y && rm -rf /var/apt
|
||||||
@ -16,5 +16,5 @@ COPY --from=builder /src/target/release/x2t-sandbox /usr/local/bin/x2t-sandbox
|
|||||||
|
|
||||||
FROM base as copy-to-data
|
FROM base as copy-to-data
|
||||||
COPY --from=builder /src/target/release/x2t-sandbox /x2t-sandbox
|
COPY --from=builder /src/target/release/x2t-sandbox /x2t-sandbox
|
||||||
CMD ["cp", "-v", "/x2t-sandbox", "/data/x2t-sandbox"]
|
CMD ["cp", "-v", "x2t-sandbox", "/data/x2t-sandbox"]
|
||||||
|
|
Loading…
x
Reference in New Issue
Block a user