-
Notifications
You must be signed in to change notification settings - Fork 23
/
Dockerfile.centos8
27 lines (20 loc) · 1.5 KB
/
Dockerfile.centos8
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
FROM centos:8
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 dnf update -y && dnf groupinstall -y "Development Tools" && dnf install -y curl
RUN dnf install dnf-plugins-core
RUN dnf repolist --all
RUN dnf config-manager --set-enabled powertools
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 && \
PATH=$PATH:/opt/rubies/ruby-${RUBY_VERSION}/bin/ && gem install --no-ri --no-rdoc ffi sys-filesystem
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 SENSU_ASSET="/assets/sensu-ruby-runtime_${ASSET_VERSION}_ruby-${RUBY_VERSION}_$(source /etc/os-release && echo $ID$VERSION_ID)_$(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