-
Notifications
You must be signed in to change notification settings - Fork 333
Remove unnecessary ruby-libs package #131
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Alpine version of ruby image installs unnecessary dependency `ruby-libs`. ``` $ docker container run --rm -ti ruby:2.3-alpine /bin/sh -c 'apk -vv info | grep ruby' ruby-libs-2.3.1-r0 - Libraries necessary to run Ruby .ruby-rundeps-0 - virtual meta package ``` ``` $ docker container run --rm -ti ruby:2.3-alpine ruby -v ruby 2.3.4p301 (2017-03-30 revision 58214) [x86_64-linux-musl] ``` Currently the image contains two version of `libruby.so`: one created during building process and one installed by `apk`: ``` $ docker container run --rm -ti ruby:2.3-alpine /bin/sh -c 'find . -name libruby.so*' ./usr/lib/libruby.so.2.3 ./usr/lib/libruby.so.2.3.0 ./usr/local/lib/libruby.so ./usr/local/lib/libruby.so.2.3 ./usr/local/lib/libruby.so.2.3.0 ``` Ruby uses correct `libruby` version: ``` $ docker container run --rm -ti ruby:2.3-alpine /bin/sh -c 'ldd /usr/local/bin/ruby' /lib/ld-musl-x86_64.so.1 (0x5651cd9e5000) libruby.so.2.3 => /usr/local/lib/libruby.so.2.3 (0x7ff147d4c000) libc.musl-x86_64.so.1 => /lib/ld-musl-x86_64.so.1 (0x5651cd9e5000) ``` I think we should not install `ruby-libs` from apk. This commits removes `ruby-libs` from `.ruby-rundeps`.
I'm a little confused -- the actual change in the commits here doesn't seem to match what you've described. 😕 ( If that |
@@ -78,6 +78,7 @@ RUN set -ex \ | |||
scanelf --needed --nobanner --recursive /usr/local \ | |||
| awk '{ gsub(/,/, "\nso:", $2); print "so:" $2 }' \ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah, it's this bit that causes the trouble -- we only know that we're linked against libruby.so.2.3
, not the full path to the proper .so
file. 😞
$ docker run -it --rm ruby:2.3-alpine sh
/ # scanelf --needed --nobanner --recursive /usr/local | awk '{ gsub(/,/, "\nso:", $2); print "so:" $2 }' | sort -u
so:libc.musl-x86_64.so.1
so:libcrypto.so.1.0.0
so:libffi.so.6
so:libgdbm.so.4
so:libgdbm_compat.so.4
so:libncursesw.so.6
so:libreadline.so.6
so:libruby.so.2.3
so:libssl.so.1.0.0
so:libyaml-0.so.2
so:libz.so.1
/ #
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, and we have two libruby.so installed.
grep -v libruby
removes ruby-libs
from dependencies list. My solution is only a workaround and I would like to point at the issue.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for finding the bug, but I would like to find a general solution to apply it to images other than ruby. Many official images that build from source on alpine use these same scanelf
lines and might be have a similar problem.
🤔 😢
How about that? |
whoops, copypaste error. See this commit, actually. |
Alpine version of ruby image installs unnecessary dependency
ruby-libs
.Currently the image contains two versions of
libruby.so
: one created duringbuilding process and one installed by
apk
:Ruby uses correct
libruby
version:I think we should not install
ruby-libs
from apk.This commits removes
ruby-libs
from.ruby-rundeps
.