From a52a08720243685a87dbd0508b07d2aaa02af2b9 Mon Sep 17 00:00:00 2001 From: Bel LaPointe Date: Mon, 15 Apr 2019 14:04:41 -0600 Subject: [PATCH] ruby smaller --- do.sh | 21 +++++++++++++++++---- 1 file changed, 17 insertions(+), 4 deletions(-) diff --git a/do.sh b/do.sh index 3d9d226..73ff4bb 100755 --- a/do.sh +++ b/do.sh @@ -200,15 +200,28 @@ RUN apk update && apk add --no-cache ca-certificates #======================== +FROM '"$from"' as builder +RUN mkdir -p /var/log +RUN apk add --no-cache ruby ruby-bundler make gcc libc-dev +'"$gf"' +#CMD [] +#ENTRYPOINT ["sh"] + +#======================== + FROM '"$from"' MAINTAINER breel@qualtrics.com -RUN mkdir -p /var/log +RUN rm -rf /usr/local/lib/ruby/2.6.0/rubygems /usr/local/bundle/gems /usr/local/bundle/specifications /usr/local/lib/ruby/gems /usr/local/bundle/extensions +RUN mkdir -p /usr/local/lib/ruby/2.6.0/ /usr/local/bundle/ /usr/local/bundle/ /usr/local/lib/ruby/ /usr/local/bundle/ +COPY --from=certs /etc/ssl/certs /etc/ssl/certs +COPY --from=builder /usr/local/lib/ruby/2.6.0/rubygems /usr/local/lib/ruby/2.6.0/rubygems +COPY --from=builder /usr/local/bundle/gems /usr/local/bundle/gems +COPY --from=builder /usr/local/bundle/specifications /usr/local/bundle/specifications +COPY --from=builder /usr/local/lib/ruby/gems /usr/local/lib/ruby/gems +COPY --from=builder /usr/local/bundle/extensions /usr/local/bundle/extensions WORKDIR /main ENV HOME=/main ENV MNT=/mnt/ -COPY --from=certs /etc/ssl/certs /etc/ssl/certs -RUN apk add --no-cache ruby ruby-bundler alpine-sdk -'"$gf"' COPY '"${cp[@]}"' /main/ '"$(for dir in ${cpd[@]}; do printf "COPY $dir /main/${dir##*/}\n"; done)"' ENTRYPOINT ["ruby", "/main/'"${main##*/}"'"]