From 91c802d5e7375c6ea39d181bfa6dab2dedaf775b Mon Sep 17 00:00:00 2001 From: Max Wofford Date: Sun, 30 Mar 2025 22:12:57 -0400 Subject: [PATCH] Revert "Attempt to speed up production builds by skipping apt update (#144)" This reverts commit 65b61dc2413bb9ec4e22f470877817d87801b0e8. --- Dockerfile | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/Dockerfile b/Dockerfile index 7b84ac5..47d6a82 100644 --- a/Dockerfile +++ b/Dockerfile @@ -15,14 +15,16 @@ FROM docker.io/library/ruby:$RUBY_VERSION-slim AS base WORKDIR /rails # Install base packages -RUN apt-get install --no-install-recommends -y \ +RUN apt-get update -qq && \ + apt-get install --no-install-recommends -y \ curl \ libjemalloc2 \ libvips \ sqlite3 \ libpq5 \ vim \ - wget + wget && \ + rm -rf /var/lib/apt/lists /var/cache/apt/archives # Set production environment ENV RAILS_ENV="production" \ @@ -33,12 +35,10 @@ ENV RAILS_ENV="production" \ # Throw-away build stage to reduce size of final image FROM base AS build -# Install build dependencies -RUN apt-get install --no-install-recommends -y \ - build-essential \ - git \ - pkg-config \ - libpq-dev +# Install packages needed to build gems +RUN apt-get update -qq && \ + apt-get install --no-install-recommends -y build-essential git pkg-config libpq-dev && \ + rm -rf /var/lib/apt/lists /var/cache/apt/archives # Install application gems COPY Gemfile Gemfile.lock ./