-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
62 lines (50 loc) · 1.71 KB
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
FROM rust:1.49.0-buster
LABEL version="1.0"
LABEL description="Build crosvm, libminijail.so and seccomp policies."
LABEL maintainer="adam@adamkaminski.com"
ENV MINIJAIL_REPO=https://android.googlesource.com/platform/external/minijail
ENV CROSVM_REPO=https://chromium.googlesource.com/chromiumos/platform/crosvm
ENV ADHD_REPO=https://chromium.googlesource.com/chromiumos/third_party/adhd
ENV PLATFORM2_REPO=https://chromium.googlesource.com/chromiumos/platform2
# install dependencies
ARG DEBIAN_FRONTEND=noninteractive
RUN apt update && apt install -y \
git \
libcap-dev \
libfdt-dev \
&& rm -rf /var/lib/apt/lists/*
# minijail
ARG MINIJAIL_COMMIT=master
RUN git clone ${MINIJAIL_REPO} aosp/external/minijail && \
cd /aosp/external/minijail && \
git checkout ${MINIJAIL_COMMIT}
# crosvm
ARG CROSVM_COMMIT=master
RUN git clone ${CROSVM_REPO} platform/crosvm && \
cd /platform/crosvm && \
git checkout ${CROSVM_COMMIT}
# adhd
ARG ADHD_COMMIT=master
RUN git clone ${ADHD_REPO} third_party/adhd && \
cd /third_party/adhd && \
git checkout ${ADHD_COMMIT}
# platform2
ARG PLATFORM2_COMMIT=master
RUN git clone ${PLATFORM2_REPO} && \
cd /platform2 && \
git checkout ${PLATFORM2_COMMIT}
# buiild and install minijail
WORKDIR /aosp/external/minijail
RUN make && \
cp libminijail.so /usr/lib/ && \
cp libminijail.h /usr/include/
RUN ldconfig
# build crosvm
WORKDIR /platform/crosvm
RUN cargo build --no-default-features --release
RUN mkdir /out && \
cp /aosp/external/minijail/libminijail.so /out && \
cp /platform/crosvm/target/release/crosvm /out && \
cp -r /platform/crosvm/seccomp /out
WORKDIR /out
ENTRYPOINT ["tar", "cf", "-", "libminijail.so", "crosvm", "seccomp"]