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
This commit is contained in:
Jordan Brough 2022-06-07 08:19:32 -06:00 committed by GitHub
parent 772d92a4d3
commit 635e544124
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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/