From 1089a8971b43a675109ad886bf1f3b327c067fa1 Mon Sep 17 00:00:00 2001 From: Joe Ferguson Date: Fri, 22 Sep 2017 14:19:38 -0700 Subject: [PATCH] Adjust scanelf to properly detect runDeps --- 10/alpine/Dockerfile | 7 +++---- 9.2/alpine/Dockerfile | 7 +++---- 9.3/alpine/Dockerfile | 7 +++---- 9.4/alpine/Dockerfile | 7 +++---- 9.5/alpine/Dockerfile | 7 +++---- 9.6/alpine/Dockerfile | 7 +++---- Dockerfile-alpine.template | 7 +++---- 7 files changed, 21 insertions(+), 28 deletions(-) diff --git a/10/alpine/Dockerfile b/10/alpine/Dockerfile index 8f72372336..6d3a4de9e0 100644 --- a/10/alpine/Dockerfile +++ b/10/alpine/Dockerfile @@ -113,11 +113,10 @@ RUN set -ex \ && make -C contrib install \ \ && runDeps="$( \ - scanelf --needed --nobanner --recursive /usr/local \ - | awk '{ gsub(/,/, "\nso:", $2); print "so:" $2 }' \ - | sort -u \ - | xargs -r apk info --installed \ + scanelf --needed --nobanner --format '%n#p' --recursive /usr/local \ + | tr ',' '\n' \ | sort -u \ + | awk 'system("[ -e /usr/local/lib/" $1 " ]") == 0 { next } { print "so:" $1 }' \ )" \ && apk add --no-cache --virtual .postgresql-rundeps \ $runDeps \ diff --git a/9.2/alpine/Dockerfile b/9.2/alpine/Dockerfile index 6c871bc69e..57fc3040cf 100644 --- a/9.2/alpine/Dockerfile +++ b/9.2/alpine/Dockerfile @@ -140,11 +140,10 @@ RUN set -ex \ && make -C contrib install \ \ && runDeps="$( \ - scanelf --needed --nobanner --recursive /usr/local \ - | awk '{ gsub(/,/, "\nso:", $2); print "so:" $2 }' \ - | sort -u \ - | xargs -r apk info --installed \ + scanelf --needed --nobanner --format '%n#p' --recursive /usr/local \ + | tr ',' '\n' \ | sort -u \ + | awk 'system("[ -e /usr/local/lib/" $1 " ]") == 0 { next } { print "so:" $1 }' \ )" \ && apk add --no-cache --virtual .postgresql-rundeps \ $runDeps \ diff --git a/9.3/alpine/Dockerfile b/9.3/alpine/Dockerfile index efc9bb8ebb..aa9b1d16a1 100644 --- a/9.3/alpine/Dockerfile +++ b/9.3/alpine/Dockerfile @@ -140,11 +140,10 @@ RUN set -ex \ && make -C contrib install \ \ && runDeps="$( \ - scanelf --needed --nobanner --recursive /usr/local \ - | awk '{ gsub(/,/, "\nso:", $2); print "so:" $2 }' \ - | sort -u \ - | xargs -r apk info --installed \ + scanelf --needed --nobanner --format '%n#p' --recursive /usr/local \ + | tr ',' '\n' \ | sort -u \ + | awk 'system("[ -e /usr/local/lib/" $1 " ]") == 0 { next } { print "so:" $1 }' \ )" \ && apk add --no-cache --virtual .postgresql-rundeps \ $runDeps \ diff --git a/9.4/alpine/Dockerfile b/9.4/alpine/Dockerfile index 1edfb1b90d..b7a4e4d809 100644 --- a/9.4/alpine/Dockerfile +++ b/9.4/alpine/Dockerfile @@ -113,11 +113,10 @@ RUN set -ex \ && make -C contrib install \ \ && runDeps="$( \ - scanelf --needed --nobanner --recursive /usr/local \ - | awk '{ gsub(/,/, "\nso:", $2); print "so:" $2 }' \ - | sort -u \ - | xargs -r apk info --installed \ + scanelf --needed --nobanner --format '%n#p' --recursive /usr/local \ + | tr ',' '\n' \ | sort -u \ + | awk 'system("[ -e /usr/local/lib/" $1 " ]") == 0 { next } { print "so:" $1 }' \ )" \ && apk add --no-cache --virtual .postgresql-rundeps \ $runDeps \ diff --git a/9.5/alpine/Dockerfile b/9.5/alpine/Dockerfile index 44e28159f1..45f7eb3283 100644 --- a/9.5/alpine/Dockerfile +++ b/9.5/alpine/Dockerfile @@ -113,11 +113,10 @@ RUN set -ex \ && make -C contrib install \ \ && runDeps="$( \ - scanelf --needed --nobanner --recursive /usr/local \ - | awk '{ gsub(/,/, "\nso:", $2); print "so:" $2 }' \ - | sort -u \ - | xargs -r apk info --installed \ + scanelf --needed --nobanner --format '%n#p' --recursive /usr/local \ + | tr ',' '\n' \ | sort -u \ + | awk 'system("[ -e /usr/local/lib/" $1 " ]") == 0 { next } { print "so:" $1 }' \ )" \ && apk add --no-cache --virtual .postgresql-rundeps \ $runDeps \ diff --git a/9.6/alpine/Dockerfile b/9.6/alpine/Dockerfile index b0951d1521..3c1705f74e 100644 --- a/9.6/alpine/Dockerfile +++ b/9.6/alpine/Dockerfile @@ -113,11 +113,10 @@ RUN set -ex \ && make -C contrib install \ \ && runDeps="$( \ - scanelf --needed --nobanner --recursive /usr/local \ - | awk '{ gsub(/,/, "\nso:", $2); print "so:" $2 }' \ - | sort -u \ - | xargs -r apk info --installed \ + scanelf --needed --nobanner --format '%n#p' --recursive /usr/local \ + | tr ',' '\n' \ | sort -u \ + | awk 'system("[ -e /usr/local/lib/" $1 " ]") == 0 { next } { print "so:" $1 }' \ )" \ && apk add --no-cache --virtual .postgresql-rundeps \ $runDeps \ diff --git a/Dockerfile-alpine.template b/Dockerfile-alpine.template index a33bddc5de..f539481208 100644 --- a/Dockerfile-alpine.template +++ b/Dockerfile-alpine.template @@ -115,11 +115,10 @@ RUN set -ex \ && make -C contrib install \ \ && runDeps="$( \ - scanelf --needed --nobanner --recursive /usr/local \ - | awk '{ gsub(/,/, "\nso:", $2); print "so:" $2 }' \ - | sort -u \ - | xargs -r apk info --installed \ + scanelf --needed --nobanner --format '%n#p' --recursive /usr/local \ + | tr ',' '\n' \ | sort -u \ + | awk 'system("[ -e /usr/local/lib/" $1 " ]") == 0 { next } { print "so:" $1 }' \ )" \ && apk add --no-cache --virtual .postgresql-rundeps \ $runDeps \