From 6264822316261e7b5c5cf2a496036dca5a85b8ea Mon Sep 17 00:00:00 2001 From: Jens Ahrensfeld Date: Sun, 12 Jul 2026 23:31:56 +0200 Subject: [PATCH] Slim down runtime image and default run.sh to dogecoin-qt:latest Split the Dockerfile into a build stage (with headers/compilers) and a lean app stage with only runtime libraries, and strip binaries on install. run.sh now defaults to dogecoin-qt:latest when no image is given. Co-Authored-By: Claude Sonnet 5 Claude-Session: https://claude.ai/code/session_01TUDyiicQWXr4XVmuJEXvn3 --- Dockerfile | 53 +++++++++++++++++++++++++++-------------------------- run.sh | 3 ++- 2 files changed, 29 insertions(+), 27 deletions(-) diff --git a/Dockerfile b/Dockerfile index ad07cb6..ca8ea1f 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,34 +1,22 @@ # syntax=docker/dockerfile:1 # ------------------------------------- -FROM ubuntu:jammy as base +FROM ubuntu:jammy AS build ENV DEBIAN_FRONTEND=noninteractive -# Update -RUN apt-get update - -# Required dependencies -RUN apt-get install -y --no-install-recommends libboost-system-dev libboost-filesystem-dev libboost-chrono-dev libboost-program-options-dev libboost-test-dev libboost-thread-dev libevent-dev libssl-dev - -# Qt (required for dogecoin-qt GUI) -RUN apt-get install -y --no-install-recommends libqt5gui5 libqt5core5a libqt5dbus5 qttools5-dev qttools5-dev-tools libprotobuf-dev protobuf-compiler -RUN apt-get install -y --no-install-recommends libqrencode-dev - -RUN apt-get install -y --no-install-recommends libxkbcommon-x11-0 libxcb-xinerama0 libx11-xcb1 libx11-xcb-dev libqt5x11extras5 - -# BerkeleyDB (version 5.3) -RUN apt-get install -y --no-install-recommends libdb5.3++-dev libdb5.3++ libdb5.3-dev - -# ZMQ (provides ZMQ API 4.x) -RUN apt-get install -y --no-install-recommends libzmq3-dev +RUN apt-get update && apt-get install -y --no-install-recommends \ + build-essential libtool autotools-dev automake pkg-config bsdmainutils git autogen make gawk file \ + libboost-system-dev libboost-filesystem-dev libboost-chrono-dev libboost-program-options-dev libboost-test-dev libboost-thread-dev \ + libevent-dev libssl-dev \ + libqt5gui5 libqt5core5a libqt5dbus5 qttools5-dev qttools5-dev-tools libprotobuf-dev protobuf-compiler \ + libqrencode-dev \ + libxkbcommon-x11-0 libxcb-xinerama0 libx11-xcb1 libx11-xcb-dev libqt5x11extras5 \ + libdb5.3++-dev libdb5.3++ libdb5.3-dev \ + libzmq3-dev \ + && rm -rf /var/lib/apt/lists/* # Miniupnpc # RUN apt-get install -y libminiupnpc-dev -# ------------------------------------- -FROM base as build - -# Build tools -RUN apt-get install -y build-essential libtool autotools-dev automake pkg-config bsdmainutils git autogen make gawk file ADD https://github.com/dogecoin/dogecoin.git /tmp/dogecoin WORKDIR "/tmp/dogecoin" @@ -36,11 +24,24 @@ RUN ./autogen.sh >autogen.log RUN ./configure --with-gui -prefix=/opt/dogecoin/ >configure.log WORKDIR "/tmp/dogecoin" -RUN make -j4 && make install +RUN make -j4 && make install-strip # ------------------------------------- -FROM base as app -RUN apt-get install -y bc +FROM ubuntu:jammy AS app +ENV DEBIAN_FRONTEND=noninteractive + +# Runtime libraries only (headers/compilers stay in the build stage) +RUN apt-get update && apt-get install -y --no-install-recommends \ + bc \ + libboost-system1.74.0 libboost-filesystem1.74.0 libboost-chrono1.74.0 libboost-program-options1.74.0 libboost-thread1.74.0 \ + libevent-2.1-7 libevent-pthreads-2.1-7 libssl3 \ + libqt5gui5 libqt5core5a libqt5dbus5 libqt5x11extras5 libqt5widgets5 libqt5printsupport5 \ + libprotobuf23 \ + libqrencode4 \ + libxkbcommon-x11-0 libxcb-xinerama0 libx11-xcb1 \ + libdb5.3++ \ + libzmq5 \ + && rm -rf /var/lib/apt/lists/* COPY --from=build /opt/dogecoin /opt/dogecoin RUN rm /opt/dogecoin/bin/bench_dogecoin* diff --git a/run.sh b/run.sh index 07f4682..447e600 100755 --- a/run.sh +++ b/run.sh @@ -1,4 +1,5 @@ #/bin/bash # Run container interactive with X11 -docker container run --rm --net bridge -e DISPLAY=$DISPLAY -v /home/jens/.dogecoin:/home/doge/.dogecoin --user doge $2 -it $1 +IMAGE=${1:-dogecoin-qt:latest} +docker container run --rm --net bridge -e DISPLAY=$DISPLAY -v /home/jens/.dogecoin:/home/doge/.dogecoin --user doge $2 -it $IMAGE