Skip to content

Commit

Permalink
docker: Use git clone as the build basis for reprobuilds
Browse files Browse the repository at this point in the history
We used to use the zip archive, which comes with some baggage,
especially for some of the submodule-based dependencies. Using `git
clone` ensures that we have a clean snapshot, based on the latest
commit, and we can skip some of the wildcard operations on zip files.

Changelog-None
  • Loading branch information
cdecker committed Dec 16, 2023
1 parent b6c486c commit 41eb814
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 12 deletions.
13 changes: 7 additions & 6 deletions contrib/reprobuild/Dockerfile.focal
Original file line number Diff line number Diff line change
Expand Up @@ -58,11 +58,12 @@ RUN cd /tmp/ && \
RUN mkdir /build
WORKDIR /build

CMD poetry export -o requirements.txt --without-hashes \
# We mount the repo into `/repo` and then we take a snapshot of it
# first by cloning it. This ensures we're not including any
# uncommitted changes in the working directory on the host. Notice
# that we no longer take the zipfile.
CMD git clone /repo . \
&& poetry export -o requirements.txt --without-hashes \
&& pip install -r requirements.txt \
&& mkdir -p /repro \
&& cd /repro \
&& unzip /build/release/*.zip \
&& cd clightning* \
&& tools/repro-build.sh \
&& cp *.xz /build/release/
&& cp *.xz /repo/release/
13 changes: 7 additions & 6 deletions contrib/reprobuild/Dockerfile.jammy
Original file line number Diff line number Diff line change
Expand Up @@ -59,11 +59,12 @@ RUN cd /tmp/ && \
RUN mkdir /build
WORKDIR /build

CMD poetry export -o requirements.txt --without-hashes \
# We mount the repo into `/repo` and then we take a snapshot of it
# first by cloning it. This ensures we're not including any
# uncommitted changes in the working directory on the host. Notice
# that we no longer take the zipfile.
CMD git clone /repo . \
&& poetry export -o requirements.txt --without-hashes \
&& pip install -r requirements.txt \
&& mkdir -p /repro \
&& cd /repro \
&& unzip /build/release/*.zip \
&& cd clightning* \
&& tools/repro-build.sh \
&& cp *.xz /build/release/
&& cp *.xz /repo/release/

0 comments on commit 41eb814

Please sign in to comment.