-
Notifications
You must be signed in to change notification settings - Fork 4
/
Dockerfile
31 lines (24 loc) · 1.33 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
ARG PY_VERSION=latest
FROM python:${PY_VERSION}
ARG LLDB_VERSION=16
RUN DEBIAN_VERSION=`awk -F"[)(]+" '/VERSION=/ {print $2}' /etc/os-release` && \
wget -O - https://apt.llvm.org/llvm-snapshot.gpg.key | apt-key add - && \
echo "deb http://apt.llvm.org/${DEBIAN_VERSION}/ llvm-toolchain-${DEBIAN_VERSION}-${LLDB_VERSION} main" >> /etc/apt/sources.list; \
apt-get update && apt-get install -y lldb-${LLDB_VERSION} && \
ln -s /usr/bin/lldb-${LLDB_VERSION} /usr/bin/lldb
RUN if [ "${LLDB_VERSION}" = "9" ]; then \
# The deb package is missing this symlink; lldb won't work w/o it
ln -s /usr/lib/llvm-9/bin/lldb-server-9 /usr/lib/llvm-9/bin/lldb-server-9.0.1; \
fi && \
apt-get install -y python3-lldb-${LLDB_VERSION}
ENV PYTHONPATH /usr/lib/llvm-${LLDB_VERSION}/lib/python3/dist-packages
RUN python -m pip install poetry six
COPY . /root/.lldb/cpython-lldb
RUN cd /root/.lldb/cpython-lldb && \
poetry version $(git describe --tags --abbrev=0) && \
poetry install && poetry build -n -f wheel && \
mkdir -p ~/.lldb/cpython_lldb/site-packages && \
python -m pip install --target ~/.lldb/cpython_lldb/site-packages dist/*.whl && rm -rf dist && \
echo "command script import ~/.lldb/cpython_lldb/site-packages/cpython_lldb.py" >> /root/.lldbinit && \
chmod +x /root/.lldbinit
CMD ["/usr/bin/lldb"]