WIP: add option to build Alpine Linux image for Substrate builder to generate 236MB image size #2
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
# ldd ...
, but when you rundocker run --rm -it parity/substrate substrate --version
it outputs the following, where the version is shown after other logs. the other commands work so you can run a node:there are a lot of open issues in the repository that i'm using https://github.com/sgerrand/alpine-pkg-glibc that are likely the cause of the error
the image size is 236MB, where the
rm -rf
lines reduce it down from 250MBsize of binaries that are built are:
chain-spec-builder 21MB
node-template 74.5MB
subkey 11.5MB
substrate 96.5MB
note: after building them i copied them to local machine with
docker cp <CONTAINER_ID>:/usr/local/bin/substrate ./tmp/
and modified the dockerfile to copy the built ones across to avoid having to compile to debug.if i uncomment
ldd ...
, then when i run ./build.sh it outputs:if i use 2.35-rc0 then run ./build.sh it outputs
prior to using fetching the glibc from the https://github.com/sgerrand/alpine-pkg-glibc repository in the dockerfile, i was just using default alpine which uses busybox instead, so the dockerfile just had:
instead of all this snippet
i compared the ubuntu and alpine image sizes, where latest alpine is 3.17
inspected the image and its file size breakdown and its user groups
and then in the dockerfile i just did;
but it still gave errors when running ./build.sh (note how these are busybox errors rather than glibc errors
which overcame a lot of the folllowing errors: