Skip to content

Commit 7792a87

Browse files
authored
Merge pull request #8 from yosifkit/scanelf
Adjust scanelf to properly detect runDeps
2 parents 7535834 + 246ce07 commit 7792a87

File tree

8 files changed

+24
-32
lines changed

8 files changed

+24
-32
lines changed

3.0/Dockerfile

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -109,11 +109,10 @@ RUN set -ex; \
109109
; \
110110
\
111111
runDeps="$( \
112-
scanelf --needed --nobanner --recursive /usr/local \
113-
| awk '{ gsub(/,/, "\nso:", $2); print "so:" $2 }' \
114-
| sort -u \
115-
| xargs -r apk info --installed \
112+
scanelf --needed --nobanner --format '%n#p' --recursive /usr/local \
113+
| tr ',' '\n' \
116114
| sort -u \
115+
| awk 'system("[ -e /usr/local/lib/" $1 " ]") == 0 { next } { print "so:" $1 }' \
117116
)"; \
118117
apk add --no-cache --virtual .bash-rundeps $runDeps; \
119118
apk del .build-deps; \

3.1/Dockerfile

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -109,11 +109,10 @@ RUN set -ex; \
109109
; \
110110
\
111111
runDeps="$( \
112-
scanelf --needed --nobanner --recursive /usr/local \
113-
| awk '{ gsub(/,/, "\nso:", $2); print "so:" $2 }' \
114-
| sort -u \
115-
| xargs -r apk info --installed \
112+
scanelf --needed --nobanner --format '%n#p' --recursive /usr/local \
113+
| tr ',' '\n' \
116114
| sort -u \
115+
| awk 'system("[ -e /usr/local/lib/" $1 " ]") == 0 { next } { print "so:" $1 }' \
117116
)"; \
118117
apk add --no-cache --virtual .bash-rundeps $runDeps; \
119118
apk del .build-deps; \

3.2/Dockerfile

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -109,11 +109,10 @@ RUN set -ex; \
109109
; \
110110
\
111111
runDeps="$( \
112-
scanelf --needed --nobanner --recursive /usr/local \
113-
| awk '{ gsub(/,/, "\nso:", $2); print "so:" $2 }' \
114-
| sort -u \
115-
| xargs -r apk info --installed \
112+
scanelf --needed --nobanner --format '%n#p' --recursive /usr/local \
113+
| tr ',' '\n' \
116114
| sort -u \
115+
| awk 'system("[ -e /usr/local/lib/" $1 " ]") == 0 { next } { print "so:" $1 }' \
117116
)"; \
118117
apk add --no-cache --virtual .bash-rundeps $runDeps; \
119118
apk del .build-deps; \

4.0/Dockerfile

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -112,11 +112,10 @@ RUN set -ex; \
112112
; \
113113
\
114114
runDeps="$( \
115-
scanelf --needed --nobanner --recursive /usr/local \
116-
| awk '{ gsub(/,/, "\nso:", $2); print "so:" $2 }' \
117-
| sort -u \
118-
| xargs -r apk info --installed \
115+
scanelf --needed --nobanner --format '%n#p' --recursive /usr/local \
116+
| tr ',' '\n' \
119117
| sort -u \
118+
| awk 'system("[ -e /usr/local/lib/" $1 " ]") == 0 { next } { print "so:" $1 }' \
120119
)"; \
121120
apk add --no-cache --virtual .bash-rundeps $runDeps; \
122121
apk del .build-deps; \

4.1/Dockerfile

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -109,11 +109,10 @@ RUN set -ex; \
109109
; \
110110
\
111111
runDeps="$( \
112-
scanelf --needed --nobanner --recursive /usr/local \
113-
| awk '{ gsub(/,/, "\nso:", $2); print "so:" $2 }' \
114-
| sort -u \
115-
| xargs -r apk info --installed \
112+
scanelf --needed --nobanner --format '%n#p' --recursive /usr/local \
113+
| tr ',' '\n' \
116114
| sort -u \
115+
| awk 'system("[ -e /usr/local/lib/" $1 " ]") == 0 { next } { print "so:" $1 }' \
117116
)"; \
118117
apk add --no-cache --virtual .bash-rundeps $runDeps; \
119118
apk del .build-deps; \

4.2/Dockerfile

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -109,11 +109,10 @@ RUN set -ex; \
109109
; \
110110
\
111111
runDeps="$( \
112-
scanelf --needed --nobanner --recursive /usr/local \
113-
| awk '{ gsub(/,/, "\nso:", $2); print "so:" $2 }' \
114-
| sort -u \
115-
| xargs -r apk info --installed \
112+
scanelf --needed --nobanner --format '%n#p' --recursive /usr/local \
113+
| tr ',' '\n' \
116114
| sort -u \
115+
| awk 'system("[ -e /usr/local/lib/" $1 " ]") == 0 { next } { print "so:" $1 }' \
117116
)"; \
118117
apk add --no-cache --virtual .bash-rundeps $runDeps; \
119118
apk del .build-deps; \

4.3/Dockerfile

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -110,11 +110,10 @@ RUN set -ex; \
110110
; \
111111
\
112112
runDeps="$( \
113-
scanelf --needed --nobanner --recursive /usr/local \
114-
| awk '{ gsub(/,/, "\nso:", $2); print "so:" $2 }' \
115-
| sort -u \
116-
| xargs -r apk info --installed \
113+
scanelf --needed --nobanner --format '%n#p' --recursive /usr/local \
114+
| tr ',' '\n' \
117115
| sort -u \
116+
| awk 'system("[ -e /usr/local/lib/" $1 " ]") == 0 { next } { print "so:" $1 }' \
118117
)"; \
119118
apk add --no-cache --virtual .bash-rundeps $runDeps; \
120119
apk del .build-deps; \

4.4/Dockerfile

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -110,11 +110,10 @@ RUN set -ex; \
110110
; \
111111
\
112112
runDeps="$( \
113-
scanelf --needed --nobanner --recursive /usr/local \
114-
| awk '{ gsub(/,/, "\nso:", $2); print "so:" $2 }' \
115-
| sort -u \
116-
| xargs -r apk info --installed \
113+
scanelf --needed --nobanner --format '%n#p' --recursive /usr/local \
114+
| tr ',' '\n' \
117115
| sort -u \
116+
| awk 'system("[ -e /usr/local/lib/" $1 " ]") == 0 { next } { print "so:" $1 }' \
118117
)"; \
119118
apk add --no-cache --virtual .bash-rundeps $runDeps; \
120119
apk del .build-deps; \

0 commit comments

Comments
 (0)