Skip to content

Commit 5526d47

Browse files
Switch Dogecoin image to rootless and distroless
1 parent ff31ec5 commit 5526d47

File tree

4 files changed

+32
-147
lines changed

4 files changed

+32
-147
lines changed

images/dogecoind/Dockerfile

Lines changed: 31 additions & 61 deletions
Original file line numberDiff line numberDiff line change
@@ -1,82 +1,52 @@
11
# syntax=docker/dockerfile:1.3-labs
2-
FROM ubuntu:22.04 as build
2+
FROM debian:12@sha256:b6507e340c43553136f5078284c8c68d86ec8262b1724dde73c325e8d3dcdeba as build
33

44
ARG VERSION=v1.14.9
55

66
ENV DEBIAN_FRONTEND="noninteractive" TZ="Europe/London"
77

88
RUN <<-EOF
9-
apt-get -y update && \
10-
apt-get -y install \
11-
git \
12-
build-essential \
13-
libtool \
14-
autotools-dev \
15-
automake \
16-
pkg-config \
17-
bsdmainutils \
18-
python3 \
19-
python3-pip \
20-
libevent-dev \
21-
libboost-system-dev \
22-
libboost-filesystem-dev \
23-
libboost-chrono-dev \
24-
libboost-test-dev \
25-
libboost-thread-dev \
26-
libboost-program-options-dev \
27-
libssl-dev \
28-
libzmq3-dev \
29-
acl
9+
set -e
10+
apt-get -y update && apt-get -y install \
11+
git \
12+
build-essential \
13+
cmake \
14+
libtool \
15+
pkg-config \
16+
curl
3017
EOF
3118

32-
RUN <<-EOF
33-
echo "* soft nofile 1048576" >> /etc/security/limits.conf && \
34-
echo "* hard nofile 1048576" >> /etc/security/limits.conf && \
35-
echo "{{ ops_user }} soft nofile 1048576" >> /etc/security/limits.conf && \
36-
echo "{{ ops_user }} hard nofile 1048576" >> /etc/security/limits.conf && \
37-
cat /etc/security/limits.conf && \
38-
ulimit -Sn
39-
EOF
40-
41-
RUN pip install --upgrade pip && pip3 install pexpect
42-
4319
RUN git clone --single-branch --branch "${VERSION}" https://github.com/dogecoin/dogecoin.git /opt/dogecoin
4420

4521
WORKDIR /opt/dogecoin
4622

4723
RUN <<-EOF
48-
bash ./autogen.sh && \
49-
bash ./configure --disable-wallet --without-gui --disable-tests --disable-bench --prefix=/opt/dogecoin/build && \
50-
echo $(getconf _NPROCESSORS_ONLN) && \
51-
make -j $(getconf _NPROCESSORS_ONLN) && \
52-
make install && \
53-
mkdir -p /opt/dogecoin/.dogecoin/db && \
54-
chmod 755 /opt/dogecoin/.dogecoin/db
24+
set -e
25+
make -C /opt/dogecoin/depends/ -j $(getconf _NPROCESSORS_ONLN) NO_QT=1 NO_QR=1 NO_WALLET=1 NO_BDB=1
26+
./autogen.sh
27+
./configure \
28+
--disable-wallet \
29+
--without-gui \
30+
--disable-tests \
31+
--disable-bench \
32+
--prefix=/opt/dogecoin/depends/x86_64-pc-linux-gnu/
33+
make -j $(getconf _NPROCESSORS_ONLN)
34+
make install
35+
find /opt/dogecoin/depends/x86_64-pc-linux-gnu/bin -type f -executable -exec strip -s {} + 2>/dev/null || true
5536
EOF
5637

57-
COPY ./dogecoin.conf /opt/dogecoin/.dogecoin/dogecoin.conf
38+
COPY dogecoin.conf /opt/dogecoin/.dogecoin/dogecoin.conf
5839

59-
FROM ubuntu:22.04
60-
COPY --from=build /opt/dogecoin/ /opt/dogecoin/
40+
RUN <<-EOF
41+
set -e
42+
mkdir -p /opt/dogecoin/.dogecoin/db
43+
EOF
44+
45+
FROM gcr.io/distroless/cc-debian12:nonroot@sha256:d1b8e4c52be1111aa108e959ef2a822299bb70fd1819dd250871a2601ca1e4b6 as final
6146

6247
ENV DEBIAN_FRONTEND="noninteractive" TZ="Europe/London"
63-
ENV PATH="/opt/dogecoin/build/bin:${PATH}"
6448

65-
RUN <<-EOF
66-
apt-get -y update && \
67-
apt-get -y install \
68-
libevent-dev \
69-
libboost-system-dev \
70-
libboost-filesystem-dev \
71-
libboost-chrono-dev \
72-
libboost-test-dev \
73-
libboost-thread-dev \
74-
libboost-program-options-dev \
75-
libzmq3-dev \
76-
net-tools \
77-
curl \
78-
jq \
79-
netcat
80-
EOF
49+
COPY --from=build --chown=65532:65532 /opt/dogecoin/depends/x86_64-pc-linux-gnu/bin/ /opt/dogecoin/bin/
50+
COPY --from=build --chown=65532:65532 /opt/dogecoin/.dogecoin/ /opt/dogecoin/.dogecoin/
8151

82-
ENTRYPOINT ["dogecoind", "-conf=/opt/dogecoin/.dogecoin/dogecoin.conf", "-datadir=/opt/dogecoin/.dogecoin/db", "-printtoconsole", "-txindex=1"]
52+
ENTRYPOINT ["/opt/dogecoin/bin/dogecoind", "-conf=/opt/dogecoin/.dogecoin/dogecoin.conf", "-datadir=/opt/dogecoin/.dogecoin/db", "-printtoconsole", "-txindex=1"]

images/dogecoind/Dockerfile-wls

Lines changed: 0 additions & 84 deletions
This file was deleted.

images/dogecoind/build.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
docker build --progress=plain -t flarefoundation/dogecoin:1.14.9 .
1+
docker build -t flarefoundation/dogecoin:1.14.9 .

images/dogecoind/build_from_local_archive.sh

Lines changed: 0 additions & 1 deletion
This file was deleted.

0 commit comments

Comments
 (0)