From c58a396e4bba03b35b5bcbdd1f277e33770b6ad8 Mon Sep 17 00:00:00 2001 From: Christian Decker Date: Tue, 10 Dec 2024 18:37:57 +0100 Subject: [PATCH] testserver: Move the target dir to /tmp/ When mounting in the repository, along with its target directory, we might have some issue if the host arch does not match the guest arch. We'd either use the host binary on the guest arch, or we end up compiling the guest into the host target dir, meaning the host won't work anymore. By moving the target dir into a separate directory we then don't touch the hosts' binaries. --- docker/gl-testserver/Dockerfile | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/docker/gl-testserver/Dockerfile b/docker/gl-testserver/Dockerfile index 89bdba36..3f736a7f 100644 --- a/docker/gl-testserver/Dockerfile +++ b/docker/gl-testserver/Dockerfile @@ -15,7 +15,8 @@ ENV PATH=$PATH:/home/$DOCKER_USER/.local/bin/:/opt/bitcoin/bin:/home/$DOCKER_USE ENV REPO=$REPO_PATH # Force this target dir, so the scripts can find all the binaries. -ENV CARGO_TARGET_DIR=$REPO/target +#ENV CARGO_TARGET_DIR=${REPO}/target +ENV CARGO_TARGET_DIR=/tmp/target/ RUN apt update && apt install -qqy \ curl \ @@ -57,6 +58,9 @@ RUN cd /tmp/ && \ RUN mkdir -p ${REPO_PATH} && \ chown $DOCKER_USER:users ${REPO_PATH} +ADD ../../libs/ ${REPO_PATH}/libs +ADD ../../pyproject.toml ${REPO_PATH}/ + ADD ../../ ${REPO_PATH}/ RUN chown $DOCKER_USER:users -R ${REPO_PATH} RUN chown $DOCKER_USER:users -R /home/$DOCKER_USER @@ -69,10 +73,13 @@ RUN curl \ -s -- -y --default-toolchain ${RUST_VERSION} RUN rustup default stable -RUN curl -LsSf https://astral.sh/uv/install.sh | sh - WORKDIR ${REPO_PATH}/libs/gl-testserver/ +RUN cargo build --bin gl-plugin +RUN cargo build --bin gl-signerproxy + +RUN curl -LsSf https://astral.sh/uv/install.sh | sh + RUN uv sync --locked -v RUN uv run clnvm get-all CMD uv run gltestserver run --metadata ${REPO}/ --directory ${REPO}/.gltestserver