forked from sensu/sensu-ruby32-runtime
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile.alpine3.8
30 lines (22 loc) · 1.69 KB
/
Dockerfile.alpine3.8
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
28
29
30
FROM alpine:3.8
ARG RUBY_VERSION=3.2.0
ARG ASSET_VERSION=local_build
RUN apk --no-cache add build-base gmp-dev zlib-dev gdbm-dev db-dev readline-dev libffi-dev coreutils yaml-dev linux-headers autoconf
RUN apk --no-cache add openssh-client openssl-dev libc6-compat
RUN apk --no-cache add wget git sudo bash bash-doc bash-completion
RUN wget -O ruby-install-0.8.5.tar.gz https://github.com/postmodern/ruby-install/archive/v0.8.5.tar.gz
RUN tar -xzvf ruby-install-0.8.5.tar.gz
RUN cd ruby-install-0.8.5/ && ac_cv_func_isnan=yes ac_cv_func_isinf=yes make install
RUN ac_cv_func_isnan=yes ac_cv_func_isinf=yes ruby-install ruby ${RUBY_VERSION} -- --enable-load-relative --disable-install-doc
RUN PATH=$PATH:/opt/rubies/ruby-${RUBY_VERSION}/bin/ && gem install ffi
RUN PATH=$PATH:/opt/rubies/ruby-${RUBY_VERSION}/bin/ && gem install unf_ext
RUN PATH=$PATH:/opt/rubies/ruby-${RUBY_VERSION}/bin/ && gem install sys-filesystem
RUN LIBS=$(find /opt/rubies/ruby-${RUBY_VERSION} -type f -exec ldd {} 2>/dev/null \;| grep "=>" | grep -v "vdso.so.1" | 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 LIBS=$(apk info -L libc6-compat 2>/dev/null | grep "^lib/lib" | 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/
RUN export SENSU_ASSET="/assets/sensu-ruby-runtime_${ASSET_VERSION}_ruby-${RUBY_VERSION}_alpine3.8_$(uname -s | tr '[:upper:]' '[:lower:]')_amd64.tar.gz" && \
touch $SENSU_ASSET && \
tar -czf $SENSU_ASSET -C /opt/rubies/ruby-${RUBY_VERSION}/ .
ENV PATH=$PATH:/opt/rubies/ruby-${RUBY_VERSION}/bin