1
0
Fork 0
mirror of https://github.com/docker-library/ruby.git synced 2022-11-09 11:41:34 -05:00

Adjust scanelf to properly remove "ruby-libs" in the "2.4-alpine3.6" image

This saves ~11MB of final image size (~79.4MB down to ~68.5MB).
This commit is contained in:
Tianon Gravi 2017-09-22 13:23:58 -07:00
parent 076a28bbc3
commit c9838b69af
5 changed files with 15 additions and 20 deletions

View file

@ -75,11 +75,10 @@ RUN set -ex \
&& make install \ && make install \
\ \
&& runDeps="$( \ && runDeps="$( \
scanelf --needed --nobanner --recursive /usr/local \ scanelf --needed --nobanner --format '%n#p' --recursive /usr/local \
| awk '{ gsub(/,/, "\nso:", $2); print "so:" $2 }' \ | tr ',' '\n' \
| sort -u \
| xargs -r apk info --installed \
| sort -u \ | sort -u \
| awk 'system("[ -e /usr/local/lib/" $1 " ]") == 0 { next } { print "so:" $1 }' \
)" \ )" \
&& apk add --virtual .ruby-rundeps $runDeps \ && apk add --virtual .ruby-rundeps $runDeps \
bzip2 \ bzip2 \

View file

@ -75,11 +75,10 @@ RUN set -ex \
&& make install \ && make install \
\ \
&& runDeps="$( \ && runDeps="$( \
scanelf --needed --nobanner --recursive /usr/local \ scanelf --needed --nobanner --format '%n#p' --recursive /usr/local \
| awk '{ gsub(/,/, "\nso:", $2); print "so:" $2 }' \ | tr ',' '\n' \
| sort -u \
| xargs -r apk info --installed \
| sort -u \ | sort -u \
| awk 'system("[ -e /usr/local/lib/" $1 " ]") == 0 { next } { print "so:" $1 }' \
)" \ )" \
&& apk add --virtual .ruby-rundeps $runDeps \ && apk add --virtual .ruby-rundeps $runDeps \
bzip2 \ bzip2 \

View file

@ -75,11 +75,10 @@ RUN set -ex \
&& make install \ && make install \
\ \
&& runDeps="$( \ && runDeps="$( \
scanelf --needed --nobanner --recursive /usr/local \ scanelf --needed --nobanner --format '%n#p' --recursive /usr/local \
| awk '{ gsub(/,/, "\nso:", $2); print "so:" $2 }' \ | tr ',' '\n' \
| sort -u \
| xargs -r apk info --installed \
| sort -u \ | sort -u \
| awk 'system("[ -e /usr/local/lib/" $1 " ]") == 0 { next } { print "so:" $1 }' \
)" \ )" \
&& apk add --virtual .ruby-rundeps $runDeps \ && apk add --virtual .ruby-rundeps $runDeps \
bzip2 \ bzip2 \

View file

@ -75,11 +75,10 @@ RUN set -ex \
&& make install \ && make install \
\ \
&& runDeps="$( \ && runDeps="$( \
scanelf --needed --nobanner --recursive /usr/local \ scanelf --needed --nobanner --format '%n#p' --recursive /usr/local \
| awk '{ gsub(/,/, "\nso:", $2); print "so:" $2 }' \ | tr ',' '\n' \
| sort -u \
| xargs -r apk info --installed \
| sort -u \ | sort -u \
| awk 'system("[ -e /usr/local/lib/" $1 " ]") == 0 { next } { print "so:" $1 }' \
)" \ )" \
&& apk add --virtual .ruby-rundeps $runDeps \ && apk add --virtual .ruby-rundeps $runDeps \
bzip2 \ bzip2 \

View file

@ -75,11 +75,10 @@ RUN set -ex \
&& make install \ && make install \
\ \
&& runDeps="$( \ && runDeps="$( \
scanelf --needed --nobanner --recursive /usr/local \ scanelf --needed --nobanner --format '%n#p' --recursive /usr/local \
| awk '{ gsub(/,/, "\nso:", $2); print "so:" $2 }' \ | tr ',' '\n' \
| sort -u \
| xargs -r apk info --installed \
| sort -u \ | sort -u \
| awk 'system("[ -e /usr/local/lib/" $1 " ]") == 0 { next } { print "so:" $1 }' \
)" \ )" \
&& apk add --virtual .ruby-rundeps $runDeps \ && apk add --virtual .ruby-rundeps $runDeps \
bzip2 \ bzip2 \