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 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01TUDyiicQWXr4XVmuJEXvn3
This commit is contained in:
2026-07-12 23:31:56 +02:00
co-authored by Claude Sonnet 5
parent 3315541604
commit 6264822316
2 changed files with 29 additions and 27 deletions
+27 -26
View File
@@ -1,34 +1,22 @@
# syntax=docker/dockerfile:1 # syntax=docker/dockerfile:1
# ------------------------------------- # -------------------------------------
FROM ubuntu:jammy as base FROM ubuntu:jammy AS build
ENV DEBIAN_FRONTEND=noninteractive ENV DEBIAN_FRONTEND=noninteractive
# Update RUN apt-get update && apt-get install -y --no-install-recommends \
RUN apt-get update 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 \
# Required dependencies libevent-dev libssl-dev \
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 libqt5gui5 libqt5core5a libqt5dbus5 qttools5-dev qttools5-dev-tools libprotobuf-dev protobuf-compiler \
libqrencode-dev \
# Qt (required for dogecoin-qt GUI) libxkbcommon-x11-0 libxcb-xinerama0 libx11-xcb1 libx11-xcb-dev libqt5x11extras5 \
RUN apt-get install -y --no-install-recommends libqt5gui5 libqt5core5a libqt5dbus5 qttools5-dev qttools5-dev-tools libprotobuf-dev protobuf-compiler libdb5.3++-dev libdb5.3++ libdb5.3-dev \
RUN apt-get install -y --no-install-recommends libqrencode-dev libzmq3-dev \
&& rm -rf /var/lib/apt/lists/*
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
# Miniupnpc # Miniupnpc
# RUN apt-get install -y libminiupnpc-dev # 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 ADD https://github.com/dogecoin/dogecoin.git /tmp/dogecoin
WORKDIR "/tmp/dogecoin" WORKDIR "/tmp/dogecoin"
@@ -36,11 +24,24 @@ RUN ./autogen.sh >autogen.log
RUN ./configure --with-gui -prefix=/opt/dogecoin/ >configure.log RUN ./configure --with-gui -prefix=/opt/dogecoin/ >configure.log
WORKDIR "/tmp/dogecoin" WORKDIR "/tmp/dogecoin"
RUN make -j4 && make install RUN make -j4 && make install-strip
# ------------------------------------- # -------------------------------------
FROM base as app FROM ubuntu:jammy AS app
RUN apt-get install -y bc 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 COPY --from=build /opt/dogecoin /opt/dogecoin
RUN rm /opt/dogecoin/bin/bench_dogecoin* RUN rm /opt/dogecoin/bin/bench_dogecoin*
+2 -1
View File
@@ -1,4 +1,5 @@
#/bin/bash #/bin/bash
# Run container interactive with X11 # 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