From ea48cd3182080ac07e553576fb3752600017657e Mon Sep 17 00:00:00 2001 From: Gene Liverman Date: Wed, 27 Oct 2021 16:19:02 -0400 Subject: [PATCH] Update Dockerfile_local to rebuild faster This makes it so that cached layers can be used when all that is changing is VMPooler's code, and not its gems. --- docker/Dockerfile_local | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/docker/Dockerfile_local b/docker/Dockerfile_local index c1b3f4e8e..fb9dcf27d 100644 --- a/docker/Dockerfile_local +++ b/docker/Dockerfile_local @@ -10,9 +10,6 @@ FROM jruby:9.2-jdk -COPY docker/docker-entrypoint.sh /usr/local/bin/ -COPY ./ ./ - ENV RACK_ENV=production RUN apt-get update -qq && \ @@ -21,9 +18,18 @@ RUN apt-get update -qq && \ apt-get autoremove -y && \ rm -rf /var/lib/apt/lists/* +COPY docker/docker-entrypoint.sh /usr/local/bin/ +COPY ./Gemfile* ./ +COPY ./vmpooler.gemspec ./ +COPY ./lib/vmpooler/version.rb ./lib/vmpooler/version.rb + RUN gem install bundler && \ - bundle install && \ - gem build vmpooler.gemspec && \ + bundle config set --local jobs 3 && \ + bundle install + +COPY ./ ./ + +RUN gem build vmpooler.gemspec && \ gem install vmpooler*.gem && \ chmod +x /usr/local/bin/docker-entrypoint.sh