Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Avoid glibc dependency #230

Merged
merged 3 commits into from Mar 24, 2021
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
14 changes: 6 additions & 8 deletions 4.0/alpine/Dockerfile
Expand Up @@ -53,6 +53,8 @@ RUN set -eux; \
chmod -R ugo=rwX config db sqlite; \
find log tmp -type d -exec chmod 1777 '{}' +

# build for musl-libc, not glibc
ENV BUNDLE_FORCE_RUBY_PLATFORM 1
RUN set -eux; \
\
apk add --no-cache --virtual .build-deps \
Expand Down Expand Up @@ -88,14 +90,10 @@ RUN set -eux; \
rm /usr/local/bundle/gems/rbpdf-font-1.19.*/lib/fonts/ttf2ufm/ttf2ufm; \
\
runDeps="$( \
find /usr/local -type f -executable -exec ldd '{}' ';' \
| awk '/=>/ { print $(NF-1) }' \
| sort -u \
| grep -v '^/usr/local/' \
| xargs -rn1 basename \
| grep -v 'ld-musl-' \
| sed -e 's/^/so:/' \
| sort -u \
scanelf --needed --nobanner --format '%n#p' --recursive /usr/local/bundle/gems \
| tr ',' '\n' \
| sort -u \
| awk 'system("[ -e /usr/local/lib/" $1 " ]") == 0 { next } { print "so:" $1 }' \
)"; \
apk add --no-network --virtual .redmine-rundeps $runDeps; \
apk del --no-network .build-deps
Expand Down
14 changes: 6 additions & 8 deletions 4.1/alpine/Dockerfile
Expand Up @@ -54,6 +54,8 @@ RUN set -eux; \
chmod -R ugo=rwX config db sqlite; \
find log tmp -type d -exec chmod 1777 '{}' +

# build for musl-libc, not glibc
ENV BUNDLE_FORCE_RUBY_PLATFORM 1
RUN set -eux; \
\
apk add --no-cache --virtual .build-deps \
Expand Down Expand Up @@ -87,14 +89,10 @@ RUN set -eux; \
rm /usr/local/bundle/gems/rbpdf-font-1.19.*/lib/fonts/ttf2ufm/ttf2ufm; \
\
runDeps="$( \
find /usr/local -type f -executable -exec ldd '{}' ';' \
| awk '/=>/ { print $(NF-1) }' \
| sort -u \
| grep -v '^/usr/local/' \
| xargs -rn1 basename \
| grep -v 'ld-musl-' \
| sed -e 's/^/so:/' \
| sort -u \
scanelf --needed --nobanner --format '%n#p' --recursive /usr/local/bundle/gems \
| tr ',' '\n' \
| sort -u \
| awk 'system("[ -e /usr/local/lib/" $1 " ]") == 0 { next } { print "so:" $1 }' \
)"; \
apk add --no-network --virtual .redmine-rundeps $runDeps; \
apk del --no-network .build-deps
Expand Down
14 changes: 6 additions & 8 deletions Dockerfile-alpine.template
Expand Up @@ -54,6 +54,8 @@ RUN set -eux; \
chmod -R ugo=rwX config db sqlite; \
find log tmp -type d -exec chmod 1777 '{}' +

# build for musl-libc, not glibc
ENV BUNDLE_FORCE_RUBY_PLATFORM 1
J0WI marked this conversation as resolved.
Show resolved Hide resolved
RUN set -eux; \
\
apk add --no-cache --virtual .build-deps \
Expand Down Expand Up @@ -89,14 +91,10 @@ RUN set -eux; \
rm /usr/local/bundle/gems/rbpdf-font-1.19.*/lib/fonts/ttf2ufm/ttf2ufm; \
\
runDeps="$( \
find /usr/local -type f -executable -exec ldd '{}' ';' \
| awk '/=>/ { print $(NF-1) }' \
| sort -u \
| grep -v '^/usr/local/' \
| xargs -rn1 basename \
| grep -v 'ld-musl-' \
| sed -e 's/^/so:/' \
| sort -u \
scanelf --needed --nobanner --format '%n#p' --recursive /usr/local/bundle/gems \
| tr ',' '\n' \
| sort -u \
| awk 'system("[ -e /usr/local/lib/" $1 " ]") == 0 { next } { print "so:" $1 }' \
)"; \
apk add --no-network --virtual .redmine-rundeps $runDeps; \
apk del --no-network .build-deps
Expand Down