File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -38,17 +38,18 @@ RUN apk add --no-cache \
3838 git \
3939 libtool \
4040 linux-headers \
41- pkgconf
41+ pkgconf \
42+ upx
4243
4344RUN tar zxf bitcoin-${KNOTS_VERSION}.tar.gz
4445
4546RUN ./bitcoin-${KNOTS_VERSION}/autogen.sh
4647
4748RUN make -C bitcoin-${KNOTS_VERSION}/depends -j$(nproc) NO_QT=1 NO_NATPMP=1 NO_UPNP=1 NO_USDT=1
4849
49- ENV CFLAGS="-O2 --static -static -fPIC"
50- ENV CXXFLAGS="-O2 --static -static -fPIC"
51- ENV LDFLAGS="-s -static-libgcc -static-libstdc++"
50+ ENV CFLAGS="-g0 -Os --static -static -fPIC"
51+ ENV CXXFLAGS="-g0 -Os --static -static -fPIC"
52+ ENV LDFLAGS="-Wl,--strip-all -static-libgcc -static-libstdc++"
5253
5354RUN CONFIG_SITE=$(find /tmp/bitcoin-${KNOTS_VERSION}/depends | grep -E "config\. site$" ) \
5455 && mkdir build \
@@ -76,12 +77,14 @@ RUN make -C ./build -j$(nproc)
7677
7778RUN make -C ./build install
7879
80+ RUN upx --lzma /usr/local/bin/*
7981
8082FROM alpine:3.23 AS final
8183
8284COPY --from=builder /usr/local/bin/* /usr/local/bin/
8385
8486RUN apk add --no-cache \
87+ libgcc \
8588 libstdc++ \
8689 tor \
8790 && adduser -D bitcoin \
Original file line number Diff line number Diff line change @@ -60,13 +60,16 @@ RUN apk add --no-cache \
6060 cmake \
6161 curl \
6262 linux-headers \
63- pkgconf
63+ pkgconf \
64+ upx
6465
6566RUN tar zxf bitcoin-${KNOTS_VERSION}.tar.gz
6667
6768RUN make -C bitcoin-${KNOTS_VERSION}/depends -j$(nproc) NO_QT=1 NO_NATPMP=1 NO_UPNP=1 NO_USDT=1
6869
6970RUN cmake -S bitcoin-${KNOTS_VERSION} -B build \
71+ -DAPPEND_CPPFLAGS=-g0 \
72+ -DAPPEND_LDFLAGS=-Wl,--strip-all \
7073 -DBUILD_SHARED_LIBS=OFF \
7174 -DBUILD_TESTS=OFF \
7275 -DBUILD_TX=ON \
@@ -75,6 +78,8 @@ RUN cmake -S bitcoin-${KNOTS_VERSION} -B build \
7578 -DCMAKE_BUILD_TYPE=MinSizeRel \
7679 -DINSTALL_MAN=OFF \
7780 -DREDUCE_EXPORTS=ON \
81+ -DSECP256K1_APPEND_CFLAGS=-g0 \
82+ -DSECP256K1_APPEND_LDFLAGS=-Wl,--strip-all \
7883 -DWITH_BDB=ON \
7984 -DWITH_ZMQ=ON \
8085 --toolchain $(find /tmp/bitcoin-${KNOTS_VERSION}/depends | grep -E "toolchain\. cmake$" )
@@ -83,12 +88,14 @@ RUN cmake --build build -j $(nproc)
8388
8489RUN cmake --install build
8590
91+ RUN upx --lzma /usr/local/bin/*
8692
8793FROM alpine:3.23 AS final
8894
8995COPY --from=builder /usr/local/bin/* /usr/local/bin/
9096
9197RUN apk add --no-cache \
98+ libgcc \
9299 libstdc++ \
93100 tor \
94101 && adduser -D bitcoin \
You can’t perform that action at this time.
0 commit comments