File tree Expand file tree Collapse file tree 7 files changed +50
-2
lines changed Expand file tree Collapse file tree 7 files changed +50
-2
lines changed Original file line number Diff line number Diff line change @@ -2,15 +2,21 @@ FROM sensu/sensu-ruby-runtime-2.4.4-alpine:latest as builder
2
2
ARG ASSET_GEM
3
3
ARG GIT_REF
4
4
ARG GIT_REPO
5
+ ARG RUBY_VERSION=2.4.4
6
+
5
7
WORKDIR /assets/build/
6
- RUN apk info -vv | grep 'ssl'
7
8
RUN apk del openssl-dev
8
9
RUN apk add git
9
10
RUN apk add libressl-dev postgresql-client postgresql-dev
10
11
RUN \
11
12
gem install --no-ri --no-doc bundler && \
12
13
printf "source 'https://rubygems.org'\n\ngem \"%s\", :git => \"%s\" , :ref => \"%s\"\n" ${ASSET_GEM} ${GIT_REPO} ${GIT_REF}| tee Gemfile
13
14
RUN bundle install --path=lib/ --binstubs=bin/ --standalone
15
+
16
+ RUN LIBS=$(find ./ -type f -exec ldd {} 2>/dev/null \;| grep "=>" | grep -v "vdso.so.1" | awk '{print $3}'| sort -u ) && \
17
+ 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
18
+
19
+
14
20
RUN tar -czf /assets/${ASSET_GEM}.tar.gz -C /assets/build/ .
15
21
16
22
FROM scratch
Original file line number Diff line number Diff line change @@ -2,13 +2,20 @@ FROM sensu/sensu-ruby-runtime-2.4.4-alpine3.8:latest as builder
2
2
ARG ASSET_GEM
3
3
ARG GIT_REF
4
4
ARG GIT_REPO
5
+ ARG RUBY_VERSION=2.4.4
6
+
5
7
WORKDIR /assets/build/
8
+ RUN apk del openssl-dev
6
9
RUN apk add git
7
- RUN apk add postgresql-client postgresql-dev
10
+ RUN apk add libressl-dev postgresql-client postgresql-dev
8
11
RUN \
9
12
gem install --no-ri --no-doc bundler && \
10
13
printf "source 'https://rubygems.org'\n \ ngem \" %s\", :git => \"%s\" , :ref => \"%s\"\n" ${ASSET_GEM} ${GIT_REPO} ${GIT_REF}| tee Gemfile
11
14
RUN bundle install --path=lib/ --binstubs=bin/ --standalone
15
+
16
+ RUN LIBS=$(find ./ -type f -exec ldd {} 2>/dev/null \; | grep "=>" | grep -v "vdso.so.1" | awk '{print $3}'| sort -u ) && \
17
+ 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
18
+
12
19
RUN tar -czf /assets/${ASSET_GEM}.tar.gz -C /assets/build/ .
13
20
14
21
FROM scratch
Original file line number Diff line number Diff line change @@ -2,6 +2,9 @@ FROM sensu/sensu-ruby-runtime-2.4.4-centos:latest as builder
2
2
ARG ASSET_GEM
3
3
ARG GIT_REF
4
4
ARG GIT_REPO
5
+ 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)'
6
+ ARG RUBY_VERSION=2.4.4
7
+
5
8
WORKDIR /assets/build/
6
9
RUN yum install -y git
7
10
RUN yum install -y http://yum.postgresql.org/9.5/redhat/rhel-7-x86_64/pgdg-redhat95-9.5-3.noarch.rpm
11
14
gem install --no-ri --no-doc bundler && \
12
15
printf "source 'https://rubygems.org'\n\ngem \"%s\", :git => \"%s\" , :ref => \"%s\"\n" ${ASSET_GEM} ${GIT_REPO} ${GIT_REF}| tee Gemfile
13
16
RUN bundle install --path=lib/ --binstubs=bin/ --standalone
17
+
18
+ RUN LIBS=$(find ./ -type f -executable -exec ldd {} 2>/dev/null \;| grep "=>" | egrep -v ${GREP_EXCLUDE} | awk '{print $3}'| sort -u ) && \
19
+ 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
20
+
14
21
RUN tar -czf /assets/${ASSET_GEM}.tar.gz -C /assets/build/ .
15
22
16
23
FROM scratch
Original file line number Diff line number Diff line change @@ -2,6 +2,9 @@ FROM sensu/sensu-ruby-runtime-2.4.4-centos6:latest as builder
2
2
ARG ASSET_GEM
3
3
ARG GIT_REF
4
4
ARG GIT_REPO
5
+ 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)'
6
+ ARG RUBY_VERSION=2.4.4
7
+
5
8
WORKDIR /assets/build/
6
9
RUN yum install -y git
7
10
RUN yum install -y http://yum.postgresql.org/9.5/redhat/rhel-6-x86_64/pgdg-redhat95-9.5-3.noarch.rpm
11
14
gem install --no-ri --no-doc bundler && \
12
15
printf "source 'https://rubygems.org'\n\ngem \"%s\", :git => \"%s\" , :ref => \"%s\"\n" ${ASSET_GEM} ${GIT_REPO} ${GIT_REF}| tee Gemfile
13
16
RUN bundle install --path=lib/ --binstubs=bin/ --standalone
17
+
18
+ RUN LIBS=$(find ./ -type f -executable -exec ldd {} 2>/dev/null \;| grep "=>" | egrep -v ${GREP_EXCLUDE} | awk '{print $3}'| sort -u ) && \
19
+ 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
20
+
14
21
RUN tar -czf /assets/${ASSET_GEM}.tar.gz -C /assets/build/ .
15
22
16
23
FROM scratch
Original file line number Diff line number Diff line change @@ -2,6 +2,9 @@ FROM sensu/sensu-ruby-runtime-2.4.4-centos7:latest as builder
2
2
ARG ASSET_GEM
3
3
ARG GIT_REF
4
4
ARG GIT_REPO
5
+ 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)'
6
+ ARG RUBY_VERSION=2.4.4
7
+
5
8
WORKDIR /assets/build/
6
9
RUN yum install -y git
7
10
RUN yum install -y http://yum.postgresql.org/9.5/redhat/rhel-7-x86_64/pgdg-redhat95-9.5-3.noarch.rpm
11
14
gem install --no-ri --no-doc bundler && \
12
15
printf "source 'https://rubygems.org'\n\ngem \"%s\", :git => \"%s\" , :ref => \"%s\"\n" ${ASSET_GEM} ${GIT_REPO} ${GIT_REF}| tee Gemfile
13
16
RUN bundle install --path=lib/ --binstubs=bin/ --standalone
17
+
18
+ RUN LIBS=$(find ./ -type f -executable -exec ldd {} 2>/dev/null \;| grep "=>" | egrep -v ${GREP_EXCLUDE} | awk '{print $3}'| sort -u ) && \
19
+ 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
20
+
14
21
RUN tar -czf /assets/${ASSET_GEM}.tar.gz -C /assets/build/ .
15
22
16
23
FROM scratch
Original file line number Diff line number Diff line change @@ -2,13 +2,20 @@ FROM sensu/sensu-ruby-runtime-2.4.4-debian:latest as builder
2
2
ARG ASSET_GEM
3
3
ARG GIT_REF
4
4
ARG GIT_REPO
5
+ 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)'
6
+ ARG RUBY_VERSION=2.4.4
7
+
5
8
WORKDIR /assets/build/
6
9
RUN apt-get update && apt-get install -y git
7
10
RUN apt-get install -y libpq-dev
8
11
RUN \
9
12
gem install --no-ri --no-doc bundler && \
10
13
printf "source 'https://rubygems.org'\n\ngem \"%s\", :git => \"%s\" , :ref => \"%s\"\n" ${ASSET_GEM} ${GIT_REPO} ${GIT_REF}| tee Gemfile
11
14
RUN bundle install --path=lib/ --binstubs=bin/ --standalone
15
+
16
+ RUN LIBS=$(find ./ -type f -executable -exec ldd {} 2>/dev/null \;| grep "=>" | egrep -v ${GREP_EXCLUDE} | awk '{print $3}'| sort -u ) && \
17
+ 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
18
+
12
19
RUN tar -czf /assets/${ASSET_GEM}.tar.gz -C /assets/build/ .
13
20
14
21
FROM scratch
Original file line number Diff line number Diff line change @@ -2,13 +2,20 @@ FROM sensu/sensu-ruby-runtime-2.4.4-debian9:latest as builder
2
2
ARG ASSET_GEM
3
3
ARG GIT_REF
4
4
ARG GIT_REPO
5
+ 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)'
6
+ ARG RUBY_VERSION=2.4.4
7
+
5
8
WORKDIR /assets/build/
6
9
RUN apt-get update && apt-get install -y git
7
10
RUN apt-get install -y libpq-dev
8
11
RUN \
9
12
gem install --no-ri --no-doc bundler && \
10
13
printf "source 'https://rubygems.org'\n\ngem \"%s\", :git => \"%s\" , :ref => \"%s\"\n" ${ASSET_GEM} ${GIT_REPO} ${GIT_REF}| tee Gemfile
11
14
RUN bundle install --path=lib/ --binstubs=bin/ --standalone
15
+
16
+ RUN LIBS=$(find ./ -type f -executable -exec ldd {} 2>/dev/null \;| grep "=>" | egrep -v ${GREP_EXCLUDE} | awk '{print $3}'| sort -u ) && \
17
+ 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
18
+
12
19
RUN tar -czf /assets/${ASSET_GEM}.tar.gz -C /assets/build/ .
13
20
14
21
FROM scratch
You can’t perform that action at this time.
0 commit comments