Skip to content

Commit

Permalink
testserver: Move the target dir to /tmp/
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
cdecker committed Dec 19, 2024
1 parent 547c04f commit 88b9239
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions docker/gl-testserver/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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 \
Expand Down Expand Up @@ -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
Expand All @@ -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

0 comments on commit 88b9239

Please sign in to comment.