-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
70 lines (59 loc) · 1.72 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
63
64
65
66
67
68
69
70
ARG UBUNTU_VERSION=xenial
FROM ubuntu:${UBUNTU_VERSION} AS builder
## Deps
RUN apt-get update && apt-get install -yq \
autoconf \
automake \
g++ \
git \
gcc \
make \
texinfo \
wget
RUN apt-get clean
## Environment
ENV BASE_DIR /sources
ENV XEN_ROOT ${BASE_DIR}/xen
ENV TOOLCHAIN_ROOT ${BASE_DIR}/toolchain
ENV MINIOS_ROOT ${BASE_DIR}/minios
ENV CLICKOS_ROOT ${BASE_DIR}/clickos
## Xen Hypervisor Code
ARG XEN_BR=RELEASE-4.11.4
ARG XEN_REPO=https://github.com/xen-project/xen
RUN git clone -b ${XEN_BR} ${XEN_REPO} ${XEN_ROOT}
## Sysml Toolchain
ARG TOOLCHAIN_BR=master
ARG TOOLCHAIN_REPO=https://github.com/sysml/toolchain
RUN git clone -b ${TOOLCHAIN_BR} ${TOOLCHAIN_REPO} ${TOOLCHAIN_ROOT}
## MiniOS
ARG MINIOS_BR=master
ARG MINIOS_REPO=https://github.com/sysml/mini-os
RUN git clone -b ${MINIOS_BR} ${MINIOS_REPO} ${MINIOS_ROOT}
## Build Toolchain
WORKDIR ${TOOLCHAIN_ROOT}
RUN make -j all
ENV LWIP_ROOT "${TOOLCHAIN_ROOT}/x86_64-root/x86_64-xen-elf"
ENV NEWLIB_ROOT "${TOOLCHAIN_ROOT}/x86_64-root/x86_64-xen-elf"
## Pull ClickOS
ARG CLICKOS_BR=persistent-grants
ARG CLICKOS_REPO=https://github.com/willfantom/clickos
RUN git clone -b ${CLICKOS_BR} ${CLICKOS_REPO} ${CLICKOS_ROOT}
## Build ClickOS
ARG STATS_LEVEL=0
WORKDIR ${CLICKOS_ROOT}
RUN ./configure --with-xen=${XEN_ROOT} \
--with-minios=${MINIOS_ROOT} \
--with-newlib=${NEWLIB_ROOT} \
--with-lwip=${LWIP_ROOT} \
--enable-minios \
--enable-stats=${STATS_LEVEL} \
--enable-etherswitch
RUN make -j elemlist
RUN make -j $(getconf _NPROCESSORS_ONLN) minios
RUN mkdir -p /out \
&& mv ${CLICKOS_ROOT}/minios/build/* /out
## Multi-Stage Niceness
FROM busybox
COPY --from=builder /out/clickos_x86_64 /clickos/
WORKDIR /clickos
ENTRYPOINT [ "cp", "-va", ".", "/output" ]