Skip to content

Commit 0e5a14d

Browse files
yosifkitc0b
authored andcommitted
Adjust scanelf to ignore local libs
1 parent f5240d2 commit 0e5a14d

File tree

2 files changed

+10
-12
lines changed

2 files changed

+10
-12
lines changed

20/alpine/Dockerfile

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -39,13 +39,12 @@ RUN set -xe \
3939
&& find /usr/local -name src | xargs -r find | xargs rmdir -vp || true \
4040
&& scanelf --nobanner -E ET_EXEC -BF '%F' --recursive /usr/local | xargs -r strip --strip-all \
4141
&& scanelf --nobanner -E ET_DYN -BF '%F' --recursive /usr/local | xargs -r strip --strip-unneeded \
42-
&& runDeps=$( \
43-
scanelf --needed --nobanner --recursive /usr/local \
44-
| awk '{ gsub(/,/, "\nso:", $2); print "so:" $2 }' \
42+
&& runDeps="$( \
43+
scanelf --needed --nobanner --format '%n#p' --recursive /usr/local \
44+
| tr ',' '\n' \
4545
| sort -u \
46-
| xargs -r apk info --installed \
47-
| sort -u \
48-
) \
46+
| awk 'system("[ -e /usr/local/lib/" $1 " ]") == 0 { next } { print "so:" $1 }' \
47+
)" \
4948
&& apk add --virtual .erlang-rundeps $runDeps lksctp-tools \
5049
&& apk del .fetch-deps .build-deps
5150

master/alpine/Dockerfile

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -40,13 +40,12 @@ RUN set -xe \
4040
/usr/local/lib/erlang/lib/*/lib/lib*.a \
4141
&& scanelf --nobanner -E ET_EXEC -BF '%F' --recursive /usr/local | xargs -r strip --strip-all \
4242
&& scanelf --nobanner -E ET_DYN -BF '%F' --recursive /usr/local | xargs -r strip --strip-unneeded \
43-
&& runDeps=$( \
44-
scanelf --needed --nobanner --recursive /usr/local \
45-
| awk '{ gsub(/,/, "\nso:", $2); print "so:" $2 }' \
43+
&& runDeps="$( \
44+
scanelf --needed --nobanner --format '%n#p' --recursive /usr/local \
45+
| tr ',' '\n' \
4646
| sort -u \
47-
| xargs -r apk info --installed \
48-
| sort -u \
49-
) \
47+
| awk 'system("[ -e /usr/local/lib/" $1 " ]") == 0 { next } { print "so:" $1 }' \
48+
)" \
5049
&& apk add --virtual .erlang-rundeps lksctp-tools $runDeps \
5150
&& apk del .fetch-deps .build-deps
5251

0 commit comments

Comments
 (0)