From 6c564dc7b27d1d23a04a09d699f6c28d2d2e1f17 Mon Sep 17 00:00:00 2001 From: Dany Marcoux Date: Sun, 7 Jun 2020 23:29:12 +0200 Subject: [PATCH 1/2] Shallow clone specific release for rbenv and ruby-build We don't need the whole git history, so doing a shallow clone is favourable. Cloning a specific release (the latest at the time of writing this) allows us to have reproducible results since we're not cloning whatever is on master at the time of building the Docker image. --- Dockerfile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Dockerfile b/Dockerfile index 202bbeccf7..49f0fa4838 100644 --- a/Dockerfile +++ b/Dockerfile @@ -13,8 +13,8 @@ WORKDIR /usr/src/app COPY .ruby-version . # Install Rbenv & Ruby -RUN git clone https://github.com/rbenv/rbenv.git ${RBENV_ROOT} && \ - git clone https://github.com/rbenv/ruby-build.git ${RBENV_ROOT}/plugins/ruby-build && \ +RUN git clone --depth 1 --branch v1.1.2 https://github.com/rbenv/rbenv.git ${RBENV_ROOT} && \ + git clone --depth 1 --branch v20200520 https://github.com/rbenv/ruby-build.git ${RBENV_ROOT}/plugins/ruby-build && \ ${RBENV_ROOT}/plugins/ruby-build/install.sh && \ echo 'eval "$(rbenv init -)"' >> /etc/profile.d/rbenv.sh && \ rbenv install $(cat .ruby-version) && \ From a751d24562fb532148a8f7c007e43fded4e85b3e Mon Sep 17 00:00:00 2001 From: Dany Marcoux Date: Sun, 7 Jun 2020 23:32:46 +0200 Subject: [PATCH 2/2] Run bundler install in parallel with the amount of available CPUs --- Dockerfile | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index 49f0fa4838..c30df2f92f 100644 --- a/Dockerfile +++ b/Dockerfile @@ -43,4 +43,5 @@ RUN wget https://chromedriver.storage.googleapis.com/2.41/chromedriver_linux64.z # Copy code and install app dependencies COPY . /usr/src/app/ -RUN bundle install +# Run bundler install in parallel with the amount of available CPUs +RUN bundle install --jobs="$(nproc)"