-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathDockerfile
More file actions
59 lines (51 loc) · 1.8 KB
/
Dockerfile
File metadata and controls
59 lines (51 loc) · 1.8 KB
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
FROM ghcr.io/faasm/cpp-sysroot:0.8.0
ARG FAASM_PYTHON_VERSION
SHELL ["/bin/bash", "-c"]
ENV PYTHON_DOCKER="on"
RUN apt update \
&& apt install -y --no-install-recommends \
dpkg-dev \
libssl-dev \
pkg-config \
wget \
zlib1g \
zlib1g-dev \
&& apt autoremove -y \
&& apt clean; rm -rf /var/lib/apt/lists/*
# Clone code and submodules
RUN mkdir -p /code \
&& git clone \
-b v${FAASM_PYTHON_VERSION} \
https://github.com/faasm/python \
/code/python \
&& cd /code/python \
&& git submodule update --init -f third-party/cpp \
&& git submodule update --init -f third-party/cpython \
&& git submodule update --init -f third-party/crossenv \
&& git config --global --add safe.directory /code/python
# Cross-compile CPython to WASM and the python libraries
RUN cd /code/python \
&& ./bin/create_venv.sh \
&& source ./venv/bin/activate \
# Buld and install a native CPython and a cross-compiled CPython with the
# same version. Also cross-compile the entrypoint function for CPython
&& inv \
cpython.native \
cpython.wasm \
cpython.func
# Build cross-compiled python modules, including `pyfaasm`
# RUN cd /code/python \
# && ./bin/crossenv_setup.sh \
# && source ./cross_venv/bin/activate \
# && pip3 install -r crossenv/requirements.txt \
# && inv -r crossenv modules.build
# # Finally, install the cross-compiled Python modules
# RUN cd /code/python \
# && source ./venv/bin/activate \
# && inv modules.install
# TODO: Install experimental pacakges
# RUN . ./cross_venv/bin/activate && inv libs.install --experimental
WORKDIR /code/python
ENV TERM=xterm-256color
RUN sed -i 's/\/code\/cpp\/bin/\/code\/python\/bin/g' ~/.bashrc
CMD ["/bin/bash", "-l"]