Uh oh!
There was an error while loading. Please reload this page.
Remove unnecessary ruby-libs package - #131
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`.
tianon
commented
Jun 5, 2017
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.
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 -uso:libc.musl-x86_64.so.1so:libcrypto.so.1.0.0so:libffi.so.6so:libgdbm.so.4so:libgdbm_compat.so.4so:libncursesw.so.6so:libreadline.so.6so:libruby.so.2.3so:libssl.so.1.0.0so:libyaml-0.so.2so:libz.so.1/ # There was a problem hiding this comment.
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.
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.
🤔 😢
ojab
commented
Sep 22, 2017
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
librubyversion:I think we should not install
ruby-libsfrom apk.This commits removes
ruby-libsfrom.ruby-rundeps.