diff --git a/Dockerfile b/Dockerfile index 2aab878cdc13..a11aa2ea2996 100644 --- a/Dockerfile +++ b/Dockerfile @@ -90,6 +90,7 @@ ENV PYTHON_VERSION=3 RUN curl -sSL https://install.python-poetry.org | python3 - RUN update-alternatives --install /usr/bin/python python /usr/bin/python3.9 1 RUN pip3 install --upgrade pip setuptools wheel +ENV PATH="$PATH:/root/.local/bin" RUN wget -q https://zlib.net/fossils/zlib-1.2.13.tar.gz -O zlib.tar.gz && \ wget -q https://www.sqlite.org/2019/sqlite-src-3290000.zip -O sqlite.zip @@ -101,7 +102,7 @@ RUN git clone --recursive /tmp/lightning . && \ # Do not build python plugins (clnrest & wss-proxy) here, python doesn't support cross compilation. RUN sed -i '/^clnrest\|^wss-proxy/d' pyproject.toml && \ - /root/.local/bin/poetry export -o requirements.txt --without-hashes + poetry export -o requirements.txt --without-hashes RUN pip3 install -r requirements.txt && pip3 cache purge WORKDIR / @@ -178,6 +179,7 @@ RUN unzip sqlite.zip \ && make \ && make install && cd .. && rm sqlite.zip && rm -rf sqlite-* +ENV PATH="$PATH:/root/.local/bin" ENV RUST_PROFILE=release ENV PATH=$PATH:/root/.cargo/bin/ RUN curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y ${RUSTUP_INSTALL_OPTS} @@ -196,12 +198,12 @@ RUN ( ! [ "${target_host}" = "arm-linux-gnueabihf" ] ) || \ # Ensure that the desired grpcio-tools & protobuf versions are installed # https://github.com/ElementsProject/lightning/pull/7376#issuecomment-2161102381 -RUN /root/.local/bin/poetry lock --no-update && \ - /root/.local/bin/poetry install +RUN poetry lock --no-update && \ + poetry install RUN ./configure --prefix=/tmp/lightning_install --enable-static && \ make && \ - /root/.local/bin/poetry run make install + poetry run make install # We need to build python plugins on the target's arch because python doesn't support cross build FROM ${BASE_DISTRO} as builder-python @@ -222,9 +224,17 @@ RUN apt-get update -qq && \ apt-get clean && \ rm -rf /var/lib/apt/lists/* +# For cryptography v42 to build, we need to install latest cargo & rust (v1.80.1) +# Can't use apt install cargo rust because it installs v1.48.0 which is not compatible with cryptography v42 +RUN curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y +RUN source $HOME/.cargo/env +RUN POETRY_VIRTUALENVS_CREATE=false pip install --upgrade cryptography +RUN pip install --upgrade maturin + RUN curl -sSL https://install.python-poetry.org | python3 - RUN update-alternatives --install /usr/bin/python python /usr/bin/python3.9 1 +ENV PATH="$PATH:/root/.local/bin" ENV PYTHON_VERSION=3 WORKDIR /opt/lightningd @@ -232,12 +242,12 @@ COPY plugins/clnrest/pyproject.toml plugins/clnrest/pyproject.toml COPY plugins/wss-proxy/pyproject.toml plugins/wss-proxy/pyproject.toml RUN cd plugins/clnrest && \ - /root/.local/bin/poetry export -o requirements.txt --without-hashes && \ + poetry export -o requirements.txt --without-hashes && \ pip3 install -r requirements.txt && \ cd /opt/lightningd RUN cd plugins/wss-proxy && \ - /root/.local/bin/poetry export -o requirements.txt --without-hashes && \ + poetry export -o requirements.txt --without-hashes && \ pip3 install -r requirements.txt && \ cd /opt/lightningd && \ pip3 cache purge