Skip to content

Commit 9365bc5

Browse files
authored
Merge pull request #34 from willcl-ark/fixup-bin-dir
Fixup cmake-style binary directory
2 parents 3fea7f4 + 129df9a commit 9365bc5

File tree

2 files changed

+19
-4
lines changed

2 files changed

+19
-4
lines changed

master/Dockerfile

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,16 @@ RUN apt-get update -y \
2222
&& rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
2323

2424
ENV BITCOIN_PREFIX=/opt/bitcoin
25+
ARG COMMIT=master
26+
2527
WORKDIR /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+
2735
WORKDIR /src/bitcoin
2836

2937
RUN 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

master/alpine/Dockerfile

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,15 @@ RUN apk --no-cache add \
1919
zeromq-dev
2020

2121
ENV BITCOIN_PREFIX=/opt/bitcoin
22+
ARG COMMIT=master
23+
2224
WORKDIR /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+
2431
WORKDIR /src/bitcoin
2532

2633
RUN 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

0 commit comments

Comments
 (0)