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.
You can change the Dockerfile to get rid of this warning, but the error will remain. I’ve opened an issue for this: replace frozen-lockfile with immutable for yarn >= 2 · Issue #65 · fly-apps/dockerfile-rails · GitHub
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:
bundle platform --add-platform=x86_64-linux