From 7f780ca1b862c1629eb33af6ebc0146c6973ca22 Mon Sep 17 00:00:00 2001 From: Alistair Laing Date: Tue, 21 Apr 2020 07:50:13 +0100 Subject: [PATCH] Add --frozen-lockfile to docker image yarn install Webpacker 5.1.0 removed yarn integrity checker. This commit ensures that we also use the yarn.lock we generated while developing rather than updating it. It should also fail if package.json & yarn.lock are out of sync. Yarn's own maintainer discourages its use: https://github.com/yarnpkg/yarn/issues/6427#issuecomment-434499073 and suggests the following solution: Solution Remove the integrity initializer and the configuration options. Encourage developers to ensure yarn install in local environments and yarn install --frozen-lockfile as part of deployment. Other references: https://classic.yarnpkg.com/en/docs/cli/install#toc-yarn-install-frozen-lockfile https://github.com/rails/webpacker/pull/2518 --- Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index 2ea004781..4ec0ffa75 100644 --- a/Dockerfile +++ b/Dockerfile @@ -21,7 +21,7 @@ RUN apk add --update --no-cache --virtual build-dependances \ ADD package.json $APP_HOME/package.json ADD yarn.lock $APP_HOME/yarn.lock -RUN yarn +RUN yarn install --frozen-lockfile ADD . $APP_HOME/