Comments (9)
Partially solved by 788cb7c, partially waiting for: https://gitlab.alpinelinux.org/alpine/aports/issues/10843 โฆ
from docker-bitcoind.
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.
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.
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.
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.
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.
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.
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.
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)
- How to connect to RPC interface? HOT 4
- Optimize C flags HOT 3
- Compile in SQLite support HOT 2
- Container doesn't start after latest update HOT 4
- Documentation issue HOT 2
- Include a mechanism to set local timezone HOT 2
- Version 22.0 won't build HOT 1
- How to change log settings for writing to a log file HOT 2
- Version 0.23 has been released HOT 14
- Switch to clang? HOT 1
- IPv6 support HOT 3
- build 0.15
- Add 25.0.0 HOT 4
- bitcoin data saving to /root/.bitcoin instead of /data/.bitcoin HOT 4
- Listen Port Missing? HOT 4
- Bitcoin 0.26 has been released! HOT 7
- Changing user ID in docker-compose to match system fails to start bitcoind
- Bitcoin 0.27 has been released! HOT 1
- any plans to add testnet4?
- Expose signet ports HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google โค๏ธ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from docker-bitcoind.