File tree Expand file tree Collapse file tree 2 files changed +19
-4
lines changed Expand file tree Collapse file tree 2 files changed +19
-4
lines changed Original file line number Diff line number Diff line change @@ -22,8 +22,16 @@ RUN apt-get update -y \
2222 && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
2323
2424ENV BITCOIN_PREFIX=/opt/bitcoin
25+ ARG COMMIT=master
26+
2527WORKDIR /src
26- RUN git clone -b "master" --single-branch --depth 1 "https://github.com/bitcoin/bitcoin.git"
28+
29+ RUN git clone -b "$COMMIT" --single-branch --depth 1 "https://github.com/bitcoin/bitcoin.git" && \
30+ cd bitcoin && \
31+ git fetch origin "$COMMIT" && \
32+ git checkout "$COMMIT" && \
33+ git clean -fdx
34+
2735WORKDIR /src/bitcoin
2836
2937RUN set -ex \
@@ -37,7 +45,7 @@ RUN set -ex \
3745 -DCMAKE_INSTALL_PREFIX:PATH="${BITCOIN_PREFIX}" \
3846 -DWITH_CCACHE=ON \
3947 && cmake --build build -j$(nproc) \
40- && strip build/src /bitcoin-cli build/src /bitcoin-tx build/src /bitcoind \
48+ && strip build/bin /bitcoin-cli build/bin /bitcoin-tx build/bin /bitcoind \
4149 && cmake --install build
4250
4351# Second stage
Original file line number Diff line number Diff line change @@ -19,8 +19,15 @@ RUN apk --no-cache add \
1919 zeromq-dev
2020
2121ENV BITCOIN_PREFIX=/opt/bitcoin
22+ ARG COMMIT=master
23+
2224WORKDIR /src
23- RUN git clone -b "master" --single-branch --depth 1 "https://github.com/bitcoin/bitcoin.git"
25+ RUN git clone -b "$COMMIT" --single-branch --depth 1 "https://github.com/bitcoin/bitcoin.git" && \
26+ cd bitcoin && \
27+ git fetch origin "$COMMIT" && \
28+ git checkout "$COMMIT" && \
29+ git clean -fdx
30+
2431WORKDIR /src/bitcoin
2532
2633RUN cmake -B build \
@@ -33,7 +40,7 @@ RUN cmake -B build \
3340 -DCMAKE_INSTALL_PREFIX:PATH="${BITCOIN_PREFIX}" \
3441 -DWITH_CCACHE=ON && \
3542 cmake --build build -j$(nproc) && \
36- strip build/src /bitcoin-cli build/src /bitcoin-tx build/src /bitcoind && \
43+ strip build/bin /bitcoin-cli build/bin /bitcoin-tx build/bin /bitcoind && \
3744 cmake --install build
3845
3946# Copy build artefacts
You can’t perform that action at this time.
0 commit comments