Skip to content

Commit 6750eda

Browse files
authored
Merge pull request #344 from infosiftr/scanelf
Adjust scanelf to properly detect runDeps
2 parents 26a1e84 + 1089a89 commit 6750eda

File tree

7 files changed

+21
-28
lines changed

7 files changed

+21
-28
lines changed

10/alpine/Dockerfile

+3-4
Original file line numberDiff line numberDiff line change
@@ -113,11 +113,10 @@ RUN set -ex \
113113
&& make -C contrib install \
114114
\
115115
&& runDeps="$( \
116-
scanelf --needed --nobanner --recursive /usr/local \
117-
| awk '{ gsub(/,/, "\nso:", $2); print "so:" $2 }' \
118-
| sort -u \
119-
| xargs -r apk info --installed \
116+
scanelf --needed --nobanner --format '%n#p' --recursive /usr/local \
117+
| tr ',' '\n' \
120118
| sort -u \
119+
| awk 'system("[ -e /usr/local/lib/" $1 " ]") == 0 { next } { print "so:" $1 }' \
121120
)" \
122121
&& apk add --no-cache --virtual .postgresql-rundeps \
123122
$runDeps \

9.2/alpine/Dockerfile

+3-4
Original file line numberDiff line numberDiff line change
@@ -140,11 +140,10 @@ RUN set -ex \
140140
&& make -C contrib install \
141141
\
142142
&& runDeps="$( \
143-
scanelf --needed --nobanner --recursive /usr/local \
144-
| awk '{ gsub(/,/, "\nso:", $2); print "so:" $2 }' \
145-
| sort -u \
146-
| xargs -r apk info --installed \
143+
scanelf --needed --nobanner --format '%n#p' --recursive /usr/local \
144+
| tr ',' '\n' \
147145
| sort -u \
146+
| awk 'system("[ -e /usr/local/lib/" $1 " ]") == 0 { next } { print "so:" $1 }' \
148147
)" \
149148
&& apk add --no-cache --virtual .postgresql-rundeps \
150149
$runDeps \

9.3/alpine/Dockerfile

+3-4
Original file line numberDiff line numberDiff line change
@@ -140,11 +140,10 @@ RUN set -ex \
140140
&& make -C contrib install \
141141
\
142142
&& runDeps="$( \
143-
scanelf --needed --nobanner --recursive /usr/local \
144-
| awk '{ gsub(/,/, "\nso:", $2); print "so:" $2 }' \
145-
| sort -u \
146-
| xargs -r apk info --installed \
143+
scanelf --needed --nobanner --format '%n#p' --recursive /usr/local \
144+
| tr ',' '\n' \
147145
| sort -u \
146+
| awk 'system("[ -e /usr/local/lib/" $1 " ]") == 0 { next } { print "so:" $1 }' \
148147
)" \
149148
&& apk add --no-cache --virtual .postgresql-rundeps \
150149
$runDeps \

9.4/alpine/Dockerfile

+3-4
Original file line numberDiff line numberDiff line change
@@ -113,11 +113,10 @@ RUN set -ex \
113113
&& make -C contrib install \
114114
\
115115
&& runDeps="$( \
116-
scanelf --needed --nobanner --recursive /usr/local \
117-
| awk '{ gsub(/,/, "\nso:", $2); print "so:" $2 }' \
118-
| sort -u \
119-
| xargs -r apk info --installed \
116+
scanelf --needed --nobanner --format '%n#p' --recursive /usr/local \
117+
| tr ',' '\n' \
120118
| sort -u \
119+
| awk 'system("[ -e /usr/local/lib/" $1 " ]") == 0 { next } { print "so:" $1 }' \
121120
)" \
122121
&& apk add --no-cache --virtual .postgresql-rundeps \
123122
$runDeps \

9.5/alpine/Dockerfile

+3-4
Original file line numberDiff line numberDiff line change
@@ -113,11 +113,10 @@ RUN set -ex \
113113
&& make -C contrib install \
114114
\
115115
&& runDeps="$( \
116-
scanelf --needed --nobanner --recursive /usr/local \
117-
| awk '{ gsub(/,/, "\nso:", $2); print "so:" $2 }' \
118-
| sort -u \
119-
| xargs -r apk info --installed \
116+
scanelf --needed --nobanner --format '%n#p' --recursive /usr/local \
117+
| tr ',' '\n' \
120118
| sort -u \
119+
| awk 'system("[ -e /usr/local/lib/" $1 " ]") == 0 { next } { print "so:" $1 }' \
121120
)" \
122121
&& apk add --no-cache --virtual .postgresql-rundeps \
123122
$runDeps \

9.6/alpine/Dockerfile

+3-4
Original file line numberDiff line numberDiff line change
@@ -113,11 +113,10 @@ RUN set -ex \
113113
&& make -C contrib install \
114114
\
115115
&& runDeps="$( \
116-
scanelf --needed --nobanner --recursive /usr/local \
117-
| awk '{ gsub(/,/, "\nso:", $2); print "so:" $2 }' \
118-
| sort -u \
119-
| xargs -r apk info --installed \
116+
scanelf --needed --nobanner --format '%n#p' --recursive /usr/local \
117+
| tr ',' '\n' \
120118
| sort -u \
119+
| awk 'system("[ -e /usr/local/lib/" $1 " ]") == 0 { next } { print "so:" $1 }' \
121120
)" \
122121
&& apk add --no-cache --virtual .postgresql-rundeps \
123122
$runDeps \

Dockerfile-alpine.template

+3-4
Original file line numberDiff line numberDiff line change
@@ -115,11 +115,10 @@ RUN set -ex \
115115
&& make -C contrib install \
116116
\
117117
&& runDeps="$( \
118-
scanelf --needed --nobanner --recursive /usr/local \
119-
| awk '{ gsub(/,/, "\nso:", $2); print "so:" $2 }' \
120-
| sort -u \
121-
| xargs -r apk info --installed \
118+
scanelf --needed --nobanner --format '%n#p' --recursive /usr/local \
119+
| tr ',' '\n' \
122120
| sort -u \
121+
| awk 'system("[ -e /usr/local/lib/" $1 " ]") == 0 { next } { print "so:" $1 }' \
123122
)" \
124123
&& apk add --no-cache --virtual .postgresql-rundeps \
125124
$runDeps \

0 commit comments

Comments
 (0)