From 635e544124a91f01c86244ea7ecb6350c706a52d Mon Sep 17 00:00:00 2001 From: Jordan Brough Date: Tue, 7 Jun 2022 08:19:32 -0600 Subject: [PATCH] chore: Make "apk" commands consistent in Dockerfile (#4790) * Make "apk" commands consistent in Dockerfile 1. Add "--no-cache" to some "apk" command that are missing it * Remove "--update-cache" in Dockerfile > As of Alpine Linux 3.3 there exists a new --no-cache option for apk. It allows > users to install packages with an index that is updated and used on-the-fly and > not cached locally > > This avoids the need to use --update-cache and remove /var/cache/apk/* when > done installing packages. https://github.com/gliderlabs/docker-alpine/blob/master/docs/usage.md --- docker/Dockerfile | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/docker/Dockerfile b/docker/Dockerfile index 71a6dc72f..ca689a38b 100644 --- a/docker/Dockerfile +++ b/docker/Dockerfile @@ -15,8 +15,7 @@ ENV RAILS_ENV ${RAILS_ENV} ENV BUNDLE_PATH="/gems" -RUN apk update \ - && apk add \ +RUN apk add --no-cache \ openssl \ tar \ build-base \ @@ -85,7 +84,7 @@ ARG RAILS_ENV=production ENV RAILS_ENV ${RAILS_ENV} ENV BUNDLE_PATH="/gems" -RUN apk add --update --no-cache \ +RUN apk add --no-cache \ openssl \ tzdata \ postgresql-client \ @@ -94,7 +93,7 @@ RUN apk add --update --no-cache \ && gem install bundler RUN if [ "$RAILS_ENV" != "production" ]; then \ - apk add nodejs yarn; \ + apk add --no-cache nodejs yarn; \ fi COPY --from=pre-builder /gems/ /gems/