Build error for Next JS project

I current am getting this error when attempting to deploy:

 => ERROR [build 3/6] RUN yarn install                                                        20.1s
------                                                                                              
 > [build 3/6] RUN yarn install:                                                                    
0.528 yarn install v1.22.19                                                                         
0.602 [1/4] Resolving packages...                                                                   
0.854 [2/4] Fetching packages...                                                                    
0.962 error Couldn't find the binary git
...
Error: failed to fetch an image or build from source: error building: failed to solve: executor failed running [/bin/sh -c yarn install]: exit code: 1

This appears to happen when my docker runs:

# Install node modules

COPY --link package.json yarn.lock ./

RUN yarn install

This works fine on local but not when deploying to fly.io
Any idea what I"m doing wrong?

Was your Dockerfile provided by fly.io, or did you bring your own?

Does your yarn.lock file contain the string @git?

I’ve added support for Deploying Node/bun apps with git/github dependencies

Either upgrade @flydotio/dockerfile and run npx @flydotio/dockerfile, or add git to the following line in your Dockerfile:

THANK YOU!!! Trying it out

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.