Skip to content

Commit

Permalink
Adjust scanelf to properly detect runDeps
Browse files Browse the repository at this point in the history
  • Loading branch information
yosifkit committed Sep 22, 2017
1 parent 666c5c0 commit e4672ea
Show file tree
Hide file tree
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
Expand Up @@ -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
Expand Down
8 changes: 3 additions & 5 deletions Dockerfile-cli.template
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
8 changes: 3 additions & 5 deletions php5.6/cli/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
8 changes: 3 additions & 5 deletions php5.6/fpm-alpine/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
8 changes: 3 additions & 5 deletions php7.0/cli/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
8 changes: 3 additions & 5 deletions php7.0/fpm-alpine/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
8 changes: 3 additions & 5 deletions php7.1/cli/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
8 changes: 3 additions & 5 deletions php7.1/fpm-alpine/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit e4672ea

Please sign in to comment.