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:
+27
-26
@@ -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*
|
||||
|
||||
Reference in New Issue
Block a user