Dockerfile in sinclair-1.5.2 vs Dockerfile in sinclair-1.6.0
- old
+ new
@@ -1,30 +1,21 @@
-FROM darthjee/ruby_gems:0.2.3 as base
-FROM darthjee/scripts:0.1.2 as scripts
+FROM darthjee/scripts:0.1.7 as scripts
+FROM darthjee/ruby_gems:0.5.0 as base
+
+COPY --chown=app:app ./ /home/app/app/
+
######################################
FROM base as builder
-COPY --chown=app ./ /home/app/app/
-COPY --chown=app:app --from=scripts /home/scripts/builder/bundle_builder.sh /usr/local/sbin/
+COPY --chown=app:app --from=scripts /home/scripts/builder/bundle_builder.sh /usr/local/sbin/bundle_builder.sh
ENV HOME_DIR /home/app
RUN bundle_builder.sh
#######################
#FINAL IMAGE
FROM base
-RUN mkdir lib/sinclair -p
-USER root
-
-COPY --chown=app:app --from=builder /home/app/bundle/gems /usr/local/bundle/gems
-COPY --chown=app:app --from=builder /home/app/bundle/cache /usr/local/bundle/cache
-COPY --chown=app:app --from=builder /home/app/bundle/specifications /usr/local/bundle/specifications
-COPY --chown=app:app --from=builder /home/app/bundle/bin /usr/local/bundle/bin
-COPY --chown=app:app --from=builder /home/app/bundle/extensions /usr/local/bundle/extensions
-
-COPY --chown=app ./*.gemspec ./Gemfile /home/app/app/
-COPY --chown=app ./lib/sinclair/version.rb /home/app/app/lib/sinclair/
-USER app
+COPY --chown=app:app --from=builder /home/app/bundle/ /usr/local/bundle/
RUN bundle install