There is two problems going on here. One is that frozen-lockfile was replaced with immutable starting in yarn 2, but apparently was just an alias and now starting with yarn 4 produces a warning. But that is just a warning.
The more important question: why is your yarn.lock “stale”? There normally are two reasons for this. One is simply that you haven’t run “yarn install” on your machine since the last change to the dependencies in your package.json. The other is that you have installed native gems for your platform (perhaps M1/M2 or arm?), but these won’t work on the target machine. This can be corrected with:
Thank you for your reply! You were correct, the yarn warning wasn’t the problem, but a stale lockfile. Weirdly though, it seems it was because of the package.lock instead of the yarn.lock, because I am sure I had run yarn install after the last changes, and my issue was solved by running npm install instead, the deploy finished fine after that. Based on your tip of the lockfile being stale, the issue was solved by running npm install. Removing the package-lock.json file resulted in this error:
=> ERROR [build 5/9] COPY --link package.json package-lock.json yarn.lock ./ 0.0s
------
> [build 5/9] COPY --link package.json package-lock.json yarn.lock ./:
------
Error: failed to fetch an image or build from source: error building: failed to solve: failed to compute cache key: "/package-lock.json" not found: not found