sensu / sensu-ruby-runtime

The Sensu Go Ruby Runtime Asset
MIT License
3 stars 23 forks source link

sensu run time at arm centos #29

Open lk3687051 opened 4 years ago

lk3687051 commented 4 years ago

This is my Docker file. FROM arm64v8/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 ENV http_proxy=http://172.20.22.18:1081 ENV https_proxy=https://172.20.22.18:1081

RUN curl -L https://github.com/postmodern/ruby-install/archive/v0.7.0.tar.gz -o ruby-install-0.7.0.tar.gz && \ tar -xzvf ruby-install-0.7.0.tar.gz && \ cd ruby-install-0.7.0/ && \ make install && \ ruby-install ruby ${RUBY_VERSION} -- --enable-load-relative --disable-install-doc

RUN PATH=$PATH:/opt/rubies/ruby-${RUBY_VERSION}/bin/ && gem install ffi

Add by luke

RUN PATH=$PATH:/opt/rubies/ruby-${RUBY_VERSION}/bin/ && gem install -E sensu-plugins-process-checks \ sensu-plugins-network-checks sensu-plugins-memory-checks sensu-plugins-load-checks sensu-plugins-cpu-checks \ sensu-plugins-disk-checks sensu-plugins-ssl sensu-plugins-io-checks sensu-plugins-filesystem-checks \ sensu-plugins-load-checks sensu-plugins-raid-checks sensu-plugins-uptime-checks

RUN yum install -y sysstat RUN mv /usr/bin/iostat /opt/rubies/ruby-${RUBY_VERSION}/bin/

end

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/ && \ export SENSUASSET="/assets/sensu-ruby-runtime${ASSET_VERSION}_ruby-${RUBYVERSION}$(source /etc/os-release && echo $ID$VERSIONID)$(uname -s | tr '[:upper:]' '[:lower:]')_amd64.tar.gz" && \ tar -czf $SENSU_ASSET -C /opt/rubies/ruby-${RUBY_VERSION}/ .

ENV PATH=$PATH:/opt/rubies/ruby-${RUBY_VERSION}/bin

when I create the asset. it can not running okay. image

Then I test on the system, if I change the /var/cache/sensu/sensu-agent/338b88b568a3213fa234640da2e037d1487fc3c639bc62340f2fb71eac8af9a90566cffc768d15035406ac5c049350006d73f3a07ae15f9528e1c6a9af2944cb to some short path, It works fine.

How can I fix the problem.

lk3687051 commented 4 years ago

@jspaleta hi, Do you have some comment of this issue.