Giter VIP home page Giter VIP logo

Comments (9)

meeDamian avatar meeDamian commented on July 23, 2024

Partially solved by 788cb7c, partially waiting for: https://gitlab.alpinelinux.org/alpine/aports/issues/10843 โ€ฆ

from docker-bitcoind.

meeDamian avatar meeDamian commented on July 23, 2024

Given the response in the issue mentioned above, we should probably investigate what bitcoind really and minimally depends on, and purge everything elseโ€ฆ

from docker-bitcoind.

meeDamian avatar meeDamian commented on July 23, 2024

Maybe even add a test that runs the final image, and checks if deps of all bitcoin* binaries are satisfied ๐Ÿค”

https://superuser.com/questions/239590/find-libraries-a-binary-was-linked-against

from docker-bitcoind.

meeDamian avatar meeDamian commented on July 23, 2024

All stuff that bitcoind binaries depend on:

$ docker run --rm -it --entrypoint='sh' lncm/bitcoind:v0.18.1 -c 'find -L /opt/bitcoin-0.18.1/  -type f  ! -path "*_bitcoin*"  -exec ldd {} \; 2>/dev/null' | sort | cut -d '(' -f1 | uniq -c | sort -nr | tr -s ' ' | awk '{ print "  " $1 "  " $NF }'
  7  /usr/lib/libstdc++.so.6
  7  /usr/lib/libgcc_s.so.1
  7  /lib/ld-musl-x86_64.so.1
  7  /lib/ld-musl-x86_64.so.1
  4  /lib/libcrypto.so.43
  4  /usr/lib/libboost_thread.so.1.69.0
  4  /usr/lib/libboost_filesystem.so.1.69.0
  4  /usr/lib/libboost_chrono.so.1.69.0
  2  /usr/lib/libevent-2.1.so.6
  1  /usr/lib/libzmq.so.5
  1  /usr/lib/libsodium.so.23
  1  /usr/lib/libevent_pthreads-2.1.so.6

from docker-bitcoind.

meeDamian avatar meeDamian commented on July 23, 2024

These are all the above run against a vanilla Alpine:

$ cat /tmp/bitcoind_libs.txt| xargs -I% sh -c "docker run --rm -i --entrypoint='sh' alpine:3.10 -c 'ls %'"
ls: /usr/lib/libstdc++.so.6: No such file or directory
ls: /usr/lib/libgcc_s.so.1: No such file or directory
/lib/ld-musl-x86_64.so.1
ls: /lib/libcrypto.so.43: No such file or directory
ls: /usr/lib/libboost_thread.so.1.69.0: No such file or directory
ls: /usr/lib/libboost_filesystem.so.1.69.0: No such file or directory
ls: /usr/lib/libboost_chrono.so.1.69.0: No such file or directory
ls: /usr/lib/libevent-2.1.so.6: No such file or directory
ls: /usr/lib/libzmq.so.5: No such file or directory
ls: /usr/lib/libsodium.so.23: No such file or directory
ls: /usr/lib/libevent_pthreads-2.1.so.6: No such file or directory

Now we need to figure out the very minimal way of getting them into the system :P

Ideas @AnotherDroog?

from docker-bitcoind.

meeDamian avatar meeDamian commented on July 23, 2024

Ok looks like this:

FROM alpine:3.10

RUN apk add --no-cache libstdc++ boost-thread boost-chrono boost-filesystem libevent libsodium libzmq

satisfies most of the dependencies:

$ docker build -t min-alpine .
Sending build context to Docker daemon  2.048kB
Step 1/2 : FROM alpine:3.10
 ---> 961769676411
Step 2/2 : RUN apk add --no-cache libstdc++ boost-thread boost-chrono boost-filesystem libevent libsodium libzmq
 ---> Running in 3b7e8b0aeec7
fetch http://dl-cdn.alpinelinux.org/alpine/v3.10/main/x86_64/APKINDEX.tar.gz
fetch http://dl-cdn.alpinelinux.org/alpine/v3.10/community/x86_64/APKINDEX.tar.gz
(1/8) Installing libgcc (8.3.0-r0)
(2/8) Installing boost-chrono (1.69.0-r4)
(3/8) Installing boost-filesystem (1.69.0-r4)
(4/8) Installing boost-thread (1.69.0-r4)
(5/8) Installing libevent (2.1.10-r0)
(6/8) Installing libsodium (1.0.18-r0)
(7/8) Installing libstdc++ (8.3.0-r0)
(8/8) Installing libzmq (4.3.2-r1)
OK: 9 MiB in 22 packages
Removing intermediate container 3b7e8b0aeec7
 ---> 7f8c1c745170
Successfully built 7f8c1c745170
Successfully tagged min-alpine:latest

$ cat /tmp/bitcoind_libs.txt | xargs -I% sh -c "docker run --rm -i --entrypoint='sh' min-alpine -c 'ls %'"
/usr/lib/libstdc++.so.6
/usr/lib/libgcc_s.so.1
/lib/ld-musl-x86_64.so.1
ls: /lib/libcrypto.so.43: No such file or directory
/usr/lib/libboost_thread.so.1.69.0
/usr/lib/libboost_filesystem.so.1.69.0
/usr/lib/libboost_chrono.so.1.69.0
/usr/lib/libevent-2.1.so.6
/usr/lib/libzmq.so.5
/usr/lib/libsodium.so.23
/usr/lib/libevent_pthreads-2.1.so.6

Unclear how to get libcrypto into Alpine as of now ๐Ÿค”.

from docker-bitcoind.

meeDamian avatar meeDamian commented on July 23, 2024

Alright, seems like all are satisfied with:

FROM alpine:3.10

RUN sed -i 's|http://dl-cdn.alpinelinux.org|https://alpine.global.ssl.fastly.net|g' /etc/apk/repositories && \
    apk add --no-cache libressl libstdc++ boost-thread boost-chrono boost-filesystem libevent libsodium libzmq
$ Sending build context to Docker daemon  2.048kB
Step 1/2 : FROM alpine:3.10
 ---> 961769676411
Step 2/2 : RUN sed -i 's|http://dl-cdn.alpinelinux.org|https://alpine.global.ssl.fastly.net|g' /etc/apk/repositories &&     apk add --no-cache libressl libstdc++ boost-thread boost-chrono boost-filesystem libevent libsodium libzmq
 ---> Running in 036cdb7b9289
fetch https://alpine.global.ssl.fastly.net/alpine/v3.10/main/x86_64/APKINDEX.tar.gz
fetch https://alpine.global.ssl.fastly.net/alpine/v3.10/community/x86_64/APKINDEX.tar.gz
(1/12) Installing libgcc (8.3.0-r0)
(2/12) Installing boost-chrono (1.69.0-r4)
(3/12) Installing boost-filesystem (1.69.0-r4)
(4/12) Installing boost-thread (1.69.0-r4)
(5/12) Installing libevent (2.1.10-r0)
(6/12) Installing libressl2.7-libcrypto (2.7.5-r0)
(7/12) Installing libressl2.7-libssl (2.7.5-r0)
(8/12) Installing libressl2.7-libtls (2.7.5-r0)
(9/12) Installing libressl (2.7.5-r0)
(10/12) Installing libsodium (1.0.18-r0)
(11/12) Installing libstdc++ (8.3.0-r0)
(12/12) Installing libzmq (4.3.2-r1)
Executing busybox-1.30.1-r2.trigger
OK: 12 MiB in 26 packages
Removing intermediate container 036cdb7b9289
 ---> 31d9086bd591
Successfully built 31d9086bd591
Successfully tagged min-alpine:with-deps

$ cat /tmp/bitcoind_libs.txt | xargs -I% sh -c "docker run --rm -i --entrypoint='sh' min-alpine:with-deps -c 'ls %'"
/usr/lib/libstdc++.so.6
/usr/lib/libgcc_s.so.1
/lib/ld-musl-x86_64.so.1
/lib/libcrypto.so.43
/usr/lib/libboost_thread.so.1.69.0
/usr/lib/libboost_filesystem.so.1.69.0
/usr/lib/libboost_chrono.so.1.69.0
/usr/lib/libevent-2.1.so.6
/usr/lib/libzmq.so.5
/usr/lib/libsodium.so.23
/usr/lib/libevent_pthreads-2.1.so.6

from docker-bitcoind.

meeDamian avatar meeDamian commented on July 23, 2024

And finally a comparison of sizes of all:

$ docker images min-alpine
REPOSITORY          TAG                 IMAGE ID            CREATED              SIZE
min-alpine          with-deps           31d9086bd591        About a minute ago   11.4MB
min-alpine          old-way-3.9         f5f88463702d        6 minutes ago        19.5MB
min-alpine          old-way             f6130dd916c0        9 minutes ago        142MB
min-alpine          vanilla             961769676411        6 weeks ago          5.58MB

Seems reasonable to me. I'll change it into this once I verify it works. And write a test for it :).

from docker-bitcoind.

meeDamian avatar meeDamian commented on July 23, 2024

Fixed in ac438b8.

Looking at this, I'd say it's a success ^^

docker images lncm/bitcoind
REPOSITORY          TAG                 IMAGE ID            CREATED             SIZE
lncm/bitcoind       v0.19.0.1           fb1f400f92fd        2 days ago          50.8MB
lncm/bitcoind       v0.19.0             fef4ce9ab025        2 weeks ago         181MB
lncm/bitcoind       v0.18.1             08be1fd508a5        8 weeks ago         694MB

from docker-bitcoind.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.