Skip to content

Commit 3d5133c

Browse files
committed
Adjust scanelf to properly detect runDeps
1 parent d8a2ea0 commit 3d5133c

File tree

2 files changed

+6
-8
lines changed

2 files changed

+6
-8
lines changed

2.2/alpine/Dockerfile

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -92,11 +92,10 @@ RUN set -x \
9292
"$HTTPD_PREFIX/conf/httpd.conf" \
9393
\
9494
&& runDeps="$runDeps $( \
95-
scanelf --needed --nobanner --recursive /usr/local \
96-
| awk '{ gsub(/,/, "\nso:", $2); print "so:" $2 }' \
97-
| sort -u \
98-
| xargs -r apk info --installed \
95+
scanelf --needed --nobanner --format '%n#p' --recursive /usr/local \
96+
| tr ',' '\n' \
9997
| sort -u \
98+
| awk 'system("[ -e /usr/local/lib/" $1 " ]") == 0 { next } { print "so:" $1 }' \
10099
)" \
101100
&& apk add --virtual .httpd-rundeps $runDeps \
102101
&& apk del .build-deps

2.4/alpine/Dockerfile

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -101,11 +101,10 @@ RUN set -x \
101101
"$HTTPD_PREFIX/conf/httpd.conf" \
102102
\
103103
&& runDeps="$runDeps $( \
104-
scanelf --needed --nobanner --recursive /usr/local \
105-
| awk '{ gsub(/,/, "\nso:", $2); print "so:" $2 }' \
106-
| sort -u \
107-
| xargs -r apk info --installed \
104+
scanelf --needed --nobanner --format '%n#p' --recursive /usr/local \
105+
| tr ',' '\n' \
108106
| sort -u \
107+
| awk 'system("[ -e /usr/local/lib/" $1 " ]") == 0 { next } { print "so:" $1 }' \
109108
)" \
110109
&& apk add --virtual .httpd-rundeps $runDeps \
111110
&& apk del .build-deps

0 commit comments

Comments
 (0)