1
0
Fork 0
mirror of https://github.com/mat-1/variance.git synced 2025-08-02 15:26:04 +00:00

Fix mismatched yarn version in docker build (#10)

Adds `corepack enable` to the docker setup steps.

This fixes the following error when running e.g. `docker build -t variance:latest .`:

```
...
 => ERROR [builder 4/5] RUN yarn install                                                                                                                                                                                                       0.3s
------
 > [builder 4/5] RUN yarn install:
0.300 error This project's package.json defines "packageManager": "yarn@4.4.1". However the current global version of Yarn is 1.22.22.
0.300
0.300 Presence of the "packageManager" field indicates that the project is meant to be used with Corepack, a tool included by default with all official Node.js distributions starting from 16.9 and 14.19.
0.300 Corepack must currently be enabled by running corepack enable in your terminal. For more information, check out https://yarnpkg.com/corepack.
------

 1 warning found (use docker --debug to expand):
 - FromAsCasing: 'as' and 'FROM' keywords' casing do not match (line 2)
Dockerfile:7
--------------------
   5 |
   6 |     COPY . /src/
   7 | >>> RUN yarn install
   8 |     ENV NODE_OPTIONS=--max_old_space_size=4096
   9 |     RUN yarn build
--------------------
ERROR: failed to solve: process "/bin/sh -c yarn install" did not complete successfully: exit code: 1
```
This commit is contained in:
Kevin Montag 2024-11-10 04:44:01 +01:00 committed by GitHub
parent f884d8e46c
commit c90ea586bc
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -4,7 +4,7 @@ FROM node:20-alpine as builder
WORKDIR /src
COPY . /src/
RUN yarn install
RUN corepack enable && yarn install
ENV NODE_OPTIONS=--max_old_space_size=4096
RUN yarn build