From b86224855225013ae83904a00b34482e5aa23741 Mon Sep 17 00:00:00 2001 From: Joe Ferguson Date: Fri, 22 Sep 2017 14:18:14 -0700 Subject: [PATCH] Adjust scanelf to properly detect runDeps --- 5.6/alpine/Dockerfile | 7 +++---- 5.6/fpm/alpine/Dockerfile | 7 +++---- 5.6/zts/alpine/Dockerfile | 7 +++---- 7.0/alpine/Dockerfile | 7 +++---- 7.0/fpm/alpine/Dockerfile | 7 +++---- 7.0/zts/alpine/Dockerfile | 7 +++---- 7.1/alpine/Dockerfile | 7 +++---- 7.1/fpm/alpine/Dockerfile | 7 +++---- 7.1/zts/alpine/Dockerfile | 7 +++---- 7.2-rc/alpine/Dockerfile | 7 +++---- 7.2-rc/fpm/alpine/Dockerfile | 7 +++---- 7.2-rc/zts/alpine/Dockerfile | 7 +++---- Dockerfile-alpine.template | 7 +++---- 13 files changed, 39 insertions(+), 52 deletions(-) diff --git a/5.6/alpine/Dockerfile b/5.6/alpine/Dockerfile index df5768ae..c69a4ef9 100644 --- a/5.6/alpine/Dockerfile +++ b/5.6/alpine/Dockerfile @@ -136,11 +136,10 @@ RUN set -xe \ && docker-php-source delete \ \ && 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 .php-rundeps $runDeps \ \ diff --git a/5.6/fpm/alpine/Dockerfile b/5.6/fpm/alpine/Dockerfile index 22f5397a..595a0edf 100644 --- a/5.6/fpm/alpine/Dockerfile +++ b/5.6/fpm/alpine/Dockerfile @@ -137,11 +137,10 @@ RUN set -xe \ && docker-php-source delete \ \ && 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 .php-rundeps $runDeps \ \ diff --git a/5.6/zts/alpine/Dockerfile b/5.6/zts/alpine/Dockerfile index c67d24a5..2a6d2490 100644 --- a/5.6/zts/alpine/Dockerfile +++ b/5.6/zts/alpine/Dockerfile @@ -137,11 +137,10 @@ RUN set -xe \ && docker-php-source delete \ \ && 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 .php-rundeps $runDeps \ \ diff --git a/7.0/alpine/Dockerfile b/7.0/alpine/Dockerfile index 83fca6ec..de39fc8a 100644 --- a/7.0/alpine/Dockerfile +++ b/7.0/alpine/Dockerfile @@ -136,11 +136,10 @@ RUN set -xe \ && docker-php-source delete \ \ && 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 .php-rundeps $runDeps \ \ diff --git a/7.0/fpm/alpine/Dockerfile b/7.0/fpm/alpine/Dockerfile index 21cdc205..876961de 100644 --- a/7.0/fpm/alpine/Dockerfile +++ b/7.0/fpm/alpine/Dockerfile @@ -137,11 +137,10 @@ RUN set -xe \ && docker-php-source delete \ \ && 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 .php-rundeps $runDeps \ \ diff --git a/7.0/zts/alpine/Dockerfile b/7.0/zts/alpine/Dockerfile index 9fcdb722..242f8974 100644 --- a/7.0/zts/alpine/Dockerfile +++ b/7.0/zts/alpine/Dockerfile @@ -137,11 +137,10 @@ RUN set -xe \ && docker-php-source delete \ \ && 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 .php-rundeps $runDeps \ \ diff --git a/7.1/alpine/Dockerfile b/7.1/alpine/Dockerfile index 9e23fd47..eb4c7bc1 100644 --- a/7.1/alpine/Dockerfile +++ b/7.1/alpine/Dockerfile @@ -136,11 +136,10 @@ RUN set -xe \ && docker-php-source delete \ \ && 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 .php-rundeps $runDeps \ \ diff --git a/7.1/fpm/alpine/Dockerfile b/7.1/fpm/alpine/Dockerfile index b392785d..bbdee21e 100644 --- a/7.1/fpm/alpine/Dockerfile +++ b/7.1/fpm/alpine/Dockerfile @@ -137,11 +137,10 @@ RUN set -xe \ && docker-php-source delete \ \ && 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 .php-rundeps $runDeps \ \ diff --git a/7.1/zts/alpine/Dockerfile b/7.1/zts/alpine/Dockerfile index 12aa134b..99e5b30f 100644 --- a/7.1/zts/alpine/Dockerfile +++ b/7.1/zts/alpine/Dockerfile @@ -137,11 +137,10 @@ RUN set -xe \ && docker-php-source delete \ \ && 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 .php-rundeps $runDeps \ \ diff --git a/7.2-rc/alpine/Dockerfile b/7.2-rc/alpine/Dockerfile index 647e49a8..17ddf3d7 100644 --- a/7.2-rc/alpine/Dockerfile +++ b/7.2-rc/alpine/Dockerfile @@ -136,11 +136,10 @@ RUN set -xe \ && docker-php-source delete \ \ && 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 .php-rundeps $runDeps \ \ diff --git a/7.2-rc/fpm/alpine/Dockerfile b/7.2-rc/fpm/alpine/Dockerfile index 6c42b057..48b7a01a 100644 --- a/7.2-rc/fpm/alpine/Dockerfile +++ b/7.2-rc/fpm/alpine/Dockerfile @@ -137,11 +137,10 @@ RUN set -xe \ && docker-php-source delete \ \ && 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 .php-rundeps $runDeps \ \ diff --git a/7.2-rc/zts/alpine/Dockerfile b/7.2-rc/zts/alpine/Dockerfile index 82ea1278..9bb5264d 100644 --- a/7.2-rc/zts/alpine/Dockerfile +++ b/7.2-rc/zts/alpine/Dockerfile @@ -137,11 +137,10 @@ RUN set -xe \ && docker-php-source delete \ \ && 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 .php-rundeps $runDeps \ \ diff --git a/Dockerfile-alpine.template b/Dockerfile-alpine.template index 324c2bba..226f0390 100644 --- a/Dockerfile-alpine.template +++ b/Dockerfile-alpine.template @@ -130,11 +130,10 @@ RUN set -xe \ && docker-php-source delete \ \ && 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 .php-rundeps $runDeps \ \