Build Failed After Change to Dockerfile Then Back to Nixpacks Builder

Hello, I am trying to deploy my turborepo apps with Dockerfile, but it seems not successful yet. So, I decided to go back to Nixpacks builder. But somehow, there is errors occurred and build always failed. This below the error message
#12 [stage-0 8/12] RUN --mount=type=cache,id=s/dce34f28-7052-4a65-bbd4-6fc142db4a38-/usr/local/share/cache/yarn/v6,target=/usr/local/share/.cache/yarn/v6 yarn install --frozen-lockfile



#12 1.018 Internal Error: ENOENT: no such file or directory, open '/root/.cache/node/corepack/lastKnownGood.json'

#12 1.018 Error: ENOENT: no such file or directory, open '/root/.cache/node/corepack/lastKnownGood.json'



#12 ERROR: process "/bin/bash -ol pipefail -c yarn install --frozen-lockfile" did not complete successfully: exit code: 1

-----

> [stage-0 8/12] RUN --mount=type=cache,id=s/dce34f28-7052-4a65-bbd4-6fc142db4a38-/usr/local/share/cache/yarn/v6,target=/usr/local/share/.cache/yarn/v6 yarn install --frozen-lockfile:

1.018 Internal Error: ENOENT: no such file or directory, open '/root/.cache/node/corepack/lastKnownGood.json'

1.018 Error: ENOENT: no such file or directory, open '/root/.cache/node/corepack/lastKnownGood.json'

-----



Dockerfile:21

-------------------

19 | COPY . /app/.

20 | RUN --mount=type=cache,id=s/dce34f28-7052-4a65-bbd4-6fc142db4a38-/usr/local/share/cache/yarn/v6,target=/usr/local/share/.cache/yarn/v6 npm install -g corepack && corepack enable

21 | >>> RUN --mount=type=cache,id=s/dce34f28-7052-4a65-bbd4-6fc142db4a38-/usr/local/share/cache/yarn/v6,target=/usr/local/share/.cache/yarn/v6 yarn install --frozen-lockfile

22 |

23 | # build phase

-------------------

ERROR: failed to solve: process "/bin/bash -ol pipefail -c yarn install --frozen-lockfile" did not complete successfully: exit code: 1



Error: Docker build failed
#12 [stage-0 8/12] RUN --mount=type=cache,id=s/dce34f28-7052-4a65-bbd4-6fc142db4a38-/usr/local/share/cache/yarn/v6,target=/usr/local/share/.cache/yarn/v6 yarn install --frozen-lockfile



#12 1.018 Internal Error: ENOENT: no such file or directory, open '/root/.cache/node/corepack/lastKnownGood.json'

#12 1.018 Error: ENOENT: no such file or directory, open '/root/.cache/node/corepack/lastKnownGood.json'



#12 ERROR: process "/bin/bash -ol pipefail -c yarn install --frozen-lockfile" did not complete successfully: exit code: 1

-----

> [stage-0 8/12] RUN --mount=type=cache,id=s/dce34f28-7052-4a65-bbd4-6fc142db4a38-/usr/local/share/cache/yarn/v6,target=/usr/local/share/.cache/yarn/v6 yarn install --frozen-lockfile:

1.018 Internal Error: ENOENT: no such file or directory, open '/root/.cache/node/corepack/lastKnownGood.json'

1.018 Error: ENOENT: no such file or directory, open '/root/.cache/node/corepack/lastKnownGood.json'

-----



Dockerfile:21

-------------------

19 | COPY . /app/.

20 | RUN --mount=type=cache,id=s/dce34f28-7052-4a65-bbd4-6fc142db4a38-/usr/local/share/cache/yarn/v6,target=/usr/local/share/.cache/yarn/v6 npm install -g corepack && corepack enable

21 | >>> RUN --mount=type=cache,id=s/dce34f28-7052-4a65-bbd4-6fc142db4a38-/usr/local/share/cache/yarn/v6,target=/usr/local/share/.cache/yarn/v6 yarn install --frozen-lockfile

22 |

23 | # build phase

-------------------

ERROR: failed to solve: process "/bin/bash -ol pipefail -c yarn install --frozen-lockfile" did not complete successfully: exit code: 1



Error: Docker build failed
This error above is came from Nixpacks builder
Solution:
This is an issue with the latest version of Node.js's Corepack tool, you can use this nixpacks.toml to fix it: ```toml [phases.install] cmds = ["npm install -g [email protected] && corepack enable", "yarn install --check-cache"] dependsOn = ["setup"]...
Jump to solution
6 Replies
Percy
Percy10mo ago
Project ID: dce34f28-7052-4a65-bbd4-6fc142db4a38,dce34f28-7052-4a65-bbd4-6fc142db4a38,dce34f28-7052-4a65-bbd4-6fc142db4a38,dce34f28-7052-4a65-bbd4-6fc142db4a38
Solution
root
root10mo ago
This is an issue with the latest version of Node.js's Corepack tool, you can use this nixpacks.toml to fix it:
[phases.install]
cmds = ["npm install -g [email protected] && corepack enable", "yarn install --check-cache"]
dependsOn = ["setup"]
[phases.install]
cmds = ["npm install -g [email protected] && corepack enable", "yarn install --check-cache"]
dependsOn = ["setup"]
root
root10mo ago
Hopefully they'll release a bug fix soon.
kresnahendri
kresnahendriOP10mo ago
thank you @aleks , I'm trying to redeploy all my projects web. thank you for you support and quick response
root
root10mo ago
no problem! I hope that solved the problem.
kresnahendri
kresnahendriOP10mo ago
great, finally it works. thanks again!
Want results from more Discord servers?
Add your server