-
Notifications
You must be signed in to change notification settings - Fork 23
/
Dockerfile.alpine
29 lines (21 loc) · 1.73 KB
/
Dockerfile.alpine
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
FROM alpine:3.14.1
ARG RUBY_VERSION=2.4.4
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.7.0.tar.gz https://github.com/postmodern/ruby-install/archive/v0.7.0.tar.gz
RUN tar -xzvf ruby-install-0.7.0.tar.gz
RUN cd ruby-install-0.7.0/ && 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 --no-ri --no-rdoc ffi
RUN PATH=$PATH:/opt/rubies/ruby-${RUBY_VERSION}/bin/ && gem install --no-ri --no-rdoc unf_ext
RUN PATH=$PATH:/opt/rubies/ruby-${RUBY_VERSION}/bin/ && gem install --no-ri --no-rdoc 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/ && \
export SENSU_ASSET="/assets/sensu-ruby-runtime_${ASSET_VERSION}_ruby-${RUBY_VERSION}_alpine_$(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