-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile.debian11
15 lines (12 loc) · 1.05 KB
/
Dockerfile.debian11
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
FROM sensu-ruby32-runtime-3.2.2-debian11:0.1.2
ARG ASSET_GEM=sensu-plugins-mysql
ARG GIT_REF=d0862f1472ad2ef8cf769d5b1f8bf3e2070eb139
ARG GIT_REPO=https://github.com/opsone/sensu-plugins-mysql.git
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)'
WORKDIR /assets/build/
RUN apt-get update && apt-get install -y git libmariadb-dev-compat
RUN printf "source 'https://rubygems.org'\n\ngem '%s', git: '%s' , ref: '%s'\n" ${ASSET_GEM} ${GIT_REPO} ${GIT_REF} | tee Gemfile
RUN bundle install --path=lib/ --binstubs=bin/ --standalone
RUN LIBS=$(find ./ -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 ] && [ ! -e /opt/rubies/ruby-${RUBY_VERSION}/lib/$f ] ; then echo "Copying Library: $f" && cp $f ./lib/; fi; done
RUN tar -czf /assets/${ASSET_GEM}.tar.gz -C /assets/build/ .