-
Notifications
You must be signed in to change notification settings - Fork 69
/
base.dockerfile
54 lines (43 loc) · 1.51 KB
/
base.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
# Stage to extract Python runtime files
FROM faasm/cpython:0.1.0 as python
# Import from SGX container
FROM faasm/sgx:0.5.3 as sgx
# Note - we don't often rebuild cpp-root so this dep may be behind
FROM faasm/cpp-root:0.8.0
ARG FAASM_VERSION
# Flag to say we're in a container
ENV FAASM_DOCKER="on"
# Copy Python runtime libraries
COPY --from=python /usr/local/faasm/runtime_root /usr/local/faasm/runtime_root
# Set up SGX SDK
COPY --from=sgx /opt/intel /opt/intel
RUN apt-get update
RUN apt-get install -y nasm
# Check out code (clean beforehand just in case)
WORKDIR /usr/local/code
RUN rm -rf faasm
RUN git clone \
-b v${FAASM_VERSION} \
https://github.com/faasm/faasm
WORKDIR /usr/local/code/faasm
RUN git submodule update --init
# Set up runtime filesystem
RUN mkdir -p /usr/local/faasm/runtime_root/etc
RUN cp deploy/conf/hosts /usr/local/faasm/runtime_root/etc/
RUN cp deploy/conf/resolv.conf /usr/local/faasm/runtime_root/etc/
RUN cp deploy/conf/passwd /usr/local/faasm/runtime_root/etc/
RUN mkdir -p /usr/local/faasm/runtime_root/tmp
RUN mkdir -p /usr/local/faasm/runtime_root/share
# Out of tree build
WORKDIR /build/faasm
# Build the basics here to set up the CMake build
RUN cmake \
-GNinja \
-DCMAKE_CXX_COMPILER=/usr/bin/clang++-13 \
-DCMAKE_C_COMPILER=/usr/bin/clang-13 \
-DCMAKE_BUILD_TYPE=Release \
/usr/local/code/faasm
RUN cmake --build . --target tests
RUN cmake --build . --target func_runner
RUN cmake --build . --target codegen_func
RUN cmake --build . --target codegen_shared_obj