Skip to content

Commit

Permalink
Merge pull request #22 from sensu/gpl_libs
Browse files Browse the repository at this point in the history
exclude glibc provided libraries
  • Loading branch information
Jef Spaleta authored Aug 14, 2019
2 parents 03d08cd + 7162a95 commit da1e0d4
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 5 deletions.
5 changes: 4 additions & 1 deletion Dockerfile.centos
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@ FROM centos:7
ARG RUBY_VERSION=2.4.4
ARG ASSET_VERSION=local_build

ARG GREP_EXCLUDE='(ld.so|ld-linux-x86-64.so|libBrokenLocale.so|libSegFault.so|libanl.so|libc.so|libdl.so|libm.so|libmvec.so|libnss_compat.so|libnss_dns.so|libnss_files.so|libpthread.so|libresolv.so|librt.so|libthread_db.so|libutil.so|vdso.so)'


RUN yum update -y && yum groupinstall -y "Development Tools" && yum install -y curl

RUN curl -L https://github.com/postmodern/ruby-install/archive/v0.7.0.tar.gz -o ruby-install-0.7.0.tar.gz && \
Expand All @@ -12,7 +15,7 @@ RUN curl -L https://github.com/postmodern/ruby-install/archive/v0.7.0.tar.gz -o
ruby-install ruby ${RUBY_VERSION} -- --enable-load-relative --disable-install-doc && \
PATH=$PATH:/opt/rubies/ruby-${RUBY_VERSION}/bin/ && gem install --no-ri --no-rdoc ffi

RUN LIBS=$(find /opt/rubies/ruby-${RUBY_VERSION} -type f -executable -exec ldd {} 2>/dev/null \;| grep "=>" | grep -v "libc.so" | grep -v "vdso.so.1" | awk '{print $3}'| sort -u ) && \
RUN LIBS=$(find /opt/rubies/ruby-${RUBY_VERSION} -type f -executable -exec ldd {} 2>/dev/null \;| grep "=>" | egrep -v ${GREP_EXCLUDE} | awk '{print $3}'| sort -u ) && \
for f in $LIBS; do if [ -e $f ]; then echo "Copying Library: $f" && cp $f /opt/rubies/ruby-${RUBY_VERSION}/lib/; fi; done

RUN mkdir /assets/ && \
Expand Down
3 changes: 2 additions & 1 deletion Dockerfile.centos6
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ FROM centos:6

ARG RUBY_VERSION=2.4.4
ARG ASSET_VERSION=local_build
ARG GREP_EXCLUDE='(ld.so|ld-linux-x86-64.so|libBrokenLocale.so|libSegFault.so|libanl.so|libc.so|libdl.so|libm.so|libmvec.so|libnss_compat.so|libnss_dns.so|libnss_files.so|libpthread.so|libresolv.so|librt.so|libthread_db.so|libutil.so|vdso.so)'

RUN yum update -y && yum groupinstall -y "Development Tools" && yum install -y curl

Expand All @@ -12,7 +13,7 @@ RUN curl -L https://github.com/postmodern/ruby-install/archive/v0.7.0.tar.gz -o
ruby-install ruby ${RUBY_VERSION} -- --enable-load-relative --disable-install-doc && \
PATH=$PATH:/opt/rubies/ruby-${RUBY_VERSION}/bin/ && gem install --no-ri --no-rdoc ffi

RUN LIBS=$(find /opt/rubies/ruby-${RUBY_VERSION} -type f -executable -exec ldd {} 2>/dev/null \;| grep "=>" | grep -v "libc.so" | grep -v "vdso.so.1" | awk '{print $3}'| sort -u ) && \
RUN LIBS=$(find /opt/rubies/ruby-${RUBY_VERSION} -type f -executable -exec ldd {} 2>/dev/null \;| grep "=>" | egrep -v ${GREP_EXCLUDE} | awk '{print $3}'| sort -u ) && \
for f in $LIBS; do if [ -e $f ]; then echo "Copying Library: $f" && cp $f /opt/rubies/ruby-${RUBY_VERSION}/lib/; fi; done

RUN mkdir /assets/ && \
Expand Down
4 changes: 3 additions & 1 deletion Dockerfile.centos7
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ FROM centos:7

ARG RUBY_VERSION=2.4.4
ARG ASSET_VERSION=local_build
ARG GREP_EXCLUDE='(ld.so|ld-linux-x86-64.so|libBrokenLocale.so|libSegFault.so|libanl.so|libc.so|libdl.so|libm.so|libmvec.so|libnss_compat.so|libnss_dns.so|libnss_files.so|libpthread.so|libresolv.so|librt.so|libthread_db.so|libutil.so|vdso.so)'


RUN yum update -y && yum groupinstall -y "Development Tools" && yum install -y curl

Expand All @@ -12,7 +14,7 @@ RUN curl -L https://github.com/postmodern/ruby-install/archive/v0.7.0.tar.gz -o
ruby-install ruby ${RUBY_VERSION} -- --enable-load-relative --disable-install-doc && \
PATH=$PATH:/opt/rubies/ruby-${RUBY_VERSION}/bin/ && gem install --no-ri --no-rdoc ffi

RUN LIBS=$(find /opt/rubies/ruby-${RUBY_VERSION} -type f -executable -exec ldd {} 2>/dev/null \;| grep "=>" | grep -v "libc.so" | grep -v "vdso.so.1" | awk '{print $3}'| sort -u ) && \
RUN LIBS=$(find /opt/rubies/ruby-${RUBY_VERSION} -type f -executable -exec ldd {} 2>/dev/null \;| grep "=>" | egrep -v ${GREP_EXCLUDE} | awk '{print $3}'| sort -u ) && \
for f in $LIBS; do if [ -e $f ]; then echo "Copying Library: $f" && cp $f /opt/rubies/ruby-${RUBY_VERSION}/lib/; fi; done

RUN mkdir /assets/ && \
Expand Down
3 changes: 2 additions & 1 deletion Dockerfile.debian
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ FROM debian:stretch

ARG RUBY_VERSION=2.4.4
ARG ASSET_VERSION=local_build
ARG GREP_EXCLUDE='(ld.so|ld-linux-x86-64.so|libBrokenLocale.so|libSegFault.so|libanl.so|libc.so|libdl.so|libm.so|libmvec.so|libnss_compat.so|libnss_dns.so|libnss_files.so|libpthread.so|libresolv.so|librt.so|libthread_db.so|libutil.so|vdso.so)'

RUN apt-get update && apt-get install -y build-essential curl

Expand All @@ -12,7 +13,7 @@ RUN curl -L https://github.com/postmodern/ruby-install/archive/v0.7.0.tar.gz -o
ruby-install ruby ${RUBY_VERSION} -- --enable-load-relative --disable-install-doc && \
PATH=$PATH:/opt/rubies/ruby-${RUBY_VERSION}/bin/ && gem install --no-ri --no-rdoc ffi

RUN LIBS=$(find /opt/rubies/ruby-${RUBY_VERSION} -type f -executable -exec ldd {} 2>/dev/null \;| grep "=>" | grep -v "libc.so" | grep -v "vdso.so.1" | awk '{print $3}'| sort -u ) && \
RUN LIBS=$(find /opt/rubies/ruby-${RUBY_VERSION} -type f -executable -exec ldd {} 2>/dev/null \;| grep "=>" | egrep -v ${GREP_EXCLUDE} | awk '{print $3}'| sort -u ) && \
for f in $LIBS; do if [ -e $f ]; then echo "Copying Library: $f" && cp $f /opt/rubies/ruby-${RUBY_VERSION}/lib/; fi; done

RUN mkdir /assets/ && \
Expand Down
3 changes: 2 additions & 1 deletion Dockerfile.debian9
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ FROM debian:stretch

ARG RUBY_VERSION=2.4.4
ARG ASSET_VERSION=local_build
ARG GREP_EXCLUDE='(ld.so|ld-linux-x86-64.so|libBrokenLocale.so|libSegFault.so|libanl.so|libc.so|libdl.so|libm.so|libmvec.so|libnss_compat.so|libnss_dns.so|libnss_files.so|libpthread.so|libresolv.so|librt.so|libthread_db.so|libutil.so|vdso.so)'

RUN apt-get update && apt-get install -y build-essential curl

Expand All @@ -12,7 +13,7 @@ RUN curl -L https://github.com/postmodern/ruby-install/archive/v0.7.0.tar.gz -o
ruby-install ruby ${RUBY_VERSION} -- --enable-load-relative --disable-install-doc && \
PATH=$PATH:/opt/rubies/ruby-${RUBY_VERSION}/bin/ && gem install --no-ri --no-rdoc ffi

RUN LIBS=$(find /opt/rubies/ruby-${RUBY_VERSION} -type f -executable -exec ldd {} 2>/dev/null \;| grep "=>" | grep -v "libc.so" | grep -v "vdso.so.1" | awk '{print $3}'| sort -u ) && \
RUN LIBS=$(find /opt/rubies/ruby-${RUBY_VERSION} -type f -executable -exec ldd {} 2>/dev/null \;| grep "=>" | egrep -v ${GREP_EXCLUDE} | awk '{print $3}'| sort -u ) && \
for f in $LIBS; do if [ -e $f ]; then echo "Copying Library: $f" && cp $f /opt/rubies/ruby-${RUBY_VERSION}/lib/; fi; done

RUN mkdir /assets/ && \
Expand Down

0 comments on commit da1e0d4

Please sign in to comment.