Skip to content

Commit

Permalink
Merge pull request #240 from infosiftr/scanelf
Browse files Browse the repository at this point in the history
Adjust scanelf to properly detect runDeps
tianon authored Sep 25, 2017
2 parents 666c5c0 + e4672ea commit cf89124
Showing 8 changed files with 24 additions and 40 deletions.
8 changes: 3 additions & 5 deletions Dockerfile-alpine.template
Original file line number Diff line number Diff line change
@@ -19,12 +19,10 @@ RUN set -ex; \
docker-php-ext-install gd mysqli opcache; \
\
runDeps="$( \
scanelf --needed --nobanner --recursive \
/usr/local/lib/php/extensions \
| awk '{ gsub(/,/, "\nso:", $2); print "so:" $2 }' \
| sort -u \
| xargs -r apk info --installed \
scanelf --needed --nobanner --format '%n#p' --recursive /usr/local/lib/php/extensions \
| tr ',' '\n' \
| sort -u \
| awk 'system("[ -e /usr/local/lib/" $1 " ]") == 0 { next } { print "so:" $1 }' \
)"; \
apk add --virtual .wordpress-phpexts-rundeps $runDeps; \
apk del .build-deps
8 changes: 3 additions & 5 deletions Dockerfile-cli.template
Original file line number Diff line number Diff line change
@@ -12,12 +12,10 @@ RUN set -ex; \
docker-php-ext-install gd mysqli opcache; \
\
runDeps="$( \
scanelf --needed --nobanner --recursive \
/usr/local/lib/php/extensions \
| awk '{ gsub(/,/, "\nso:", $2); print "so:" $2 }' \
| sort -u \
| xargs -r apk info --installed \
scanelf --needed --nobanner --format '%n#p' --recursive /usr/local/lib/php/extensions \
| tr ',' '\n' \
| sort -u \
| awk 'system("[ -e /usr/local/lib/" $1 " ]") == 0 { next } { print "so:" $1 }' \
)"; \
apk add --virtual .wordpress-phpexts-rundeps $runDeps; \
apk del .build-deps
8 changes: 3 additions & 5 deletions php5.6/cli/Dockerfile
Original file line number Diff line number Diff line change
@@ -12,12 +12,10 @@ RUN set -ex; \
docker-php-ext-install gd mysqli opcache; \
\
runDeps="$( \
scanelf --needed --nobanner --recursive \
/usr/local/lib/php/extensions \
| awk '{ gsub(/,/, "\nso:", $2); print "so:" $2 }' \
| sort -u \
| xargs -r apk info --installed \
scanelf --needed --nobanner --format '%n#p' --recursive /usr/local/lib/php/extensions \
| tr ',' '\n' \
| sort -u \
| awk 'system("[ -e /usr/local/lib/" $1 " ]") == 0 { next } { print "so:" $1 }' \
)"; \
apk add --virtual .wordpress-phpexts-rundeps $runDeps; \
apk del .build-deps
8 changes: 3 additions & 5 deletions php5.6/fpm-alpine/Dockerfile
Original file line number Diff line number Diff line change
@@ -19,12 +19,10 @@ RUN set -ex; \
docker-php-ext-install gd mysqli opcache; \
\
runDeps="$( \
scanelf --needed --nobanner --recursive \
/usr/local/lib/php/extensions \
| awk '{ gsub(/,/, "\nso:", $2); print "so:" $2 }' \
| sort -u \
| xargs -r apk info --installed \
scanelf --needed --nobanner --format '%n#p' --recursive /usr/local/lib/php/extensions \
| tr ',' '\n' \
| sort -u \
| awk 'system("[ -e /usr/local/lib/" $1 " ]") == 0 { next } { print "so:" $1 }' \
)"; \
apk add --virtual .wordpress-phpexts-rundeps $runDeps; \
apk del .build-deps
8 changes: 3 additions & 5 deletions php7.0/cli/Dockerfile
Original file line number Diff line number Diff line change
@@ -12,12 +12,10 @@ RUN set -ex; \
docker-php-ext-install gd mysqli opcache; \
\
runDeps="$( \
scanelf --needed --nobanner --recursive \
/usr/local/lib/php/extensions \
| awk '{ gsub(/,/, "\nso:", $2); print "so:" $2 }' \
| sort -u \
| xargs -r apk info --installed \
scanelf --needed --nobanner --format '%n#p' --recursive /usr/local/lib/php/extensions \
| tr ',' '\n' \
| sort -u \
| awk 'system("[ -e /usr/local/lib/" $1 " ]") == 0 { next } { print "so:" $1 }' \
)"; \
apk add --virtual .wordpress-phpexts-rundeps $runDeps; \
apk del .build-deps
8 changes: 3 additions & 5 deletions php7.0/fpm-alpine/Dockerfile
Original file line number Diff line number Diff line change
@@ -19,12 +19,10 @@ RUN set -ex; \
docker-php-ext-install gd mysqli opcache; \
\
runDeps="$( \
scanelf --needed --nobanner --recursive \
/usr/local/lib/php/extensions \
| awk '{ gsub(/,/, "\nso:", $2); print "so:" $2 }' \
| sort -u \
| xargs -r apk info --installed \
scanelf --needed --nobanner --format '%n#p' --recursive /usr/local/lib/php/extensions \
| tr ',' '\n' \
| sort -u \
| awk 'system("[ -e /usr/local/lib/" $1 " ]") == 0 { next } { print "so:" $1 }' \
)"; \
apk add --virtual .wordpress-phpexts-rundeps $runDeps; \
apk del .build-deps
8 changes: 3 additions & 5 deletions php7.1/cli/Dockerfile
Original file line number Diff line number Diff line change
@@ -12,12 +12,10 @@ RUN set -ex; \
docker-php-ext-install gd mysqli opcache; \
\
runDeps="$( \
scanelf --needed --nobanner --recursive \
/usr/local/lib/php/extensions \
| awk '{ gsub(/,/, "\nso:", $2); print "so:" $2 }' \
| sort -u \
| xargs -r apk info --installed \
scanelf --needed --nobanner --format '%n#p' --recursive /usr/local/lib/php/extensions \
| tr ',' '\n' \
| sort -u \
| awk 'system("[ -e /usr/local/lib/" $1 " ]") == 0 { next } { print "so:" $1 }' \
)"; \
apk add --virtual .wordpress-phpexts-rundeps $runDeps; \
apk del .build-deps
8 changes: 3 additions & 5 deletions php7.1/fpm-alpine/Dockerfile
Original file line number Diff line number Diff line change
@@ -19,12 +19,10 @@ RUN set -ex; \
docker-php-ext-install gd mysqli opcache; \
\
runDeps="$( \
scanelf --needed --nobanner --recursive \
/usr/local/lib/php/extensions \
| awk '{ gsub(/,/, "\nso:", $2); print "so:" $2 }' \
| sort -u \
| xargs -r apk info --installed \
scanelf --needed --nobanner --format '%n#p' --recursive /usr/local/lib/php/extensions \
| tr ',' '\n' \
| sort -u \
| awk 'system("[ -e /usr/local/lib/" $1 " ]") == 0 { next } { print "so:" $1 }' \
)"; \
apk add --virtual .wordpress-phpexts-rundeps $runDeps; \
apk del .build-deps

0 comments on commit cf89124

Please sign in to comment.