My Project isn't Deploy. I think it has problem with dockerfile

hi brothers i have a problem that #14 [stage-0 8/8] RUN --mount=type=cache,id=s/8f06eb4a-56be-4f8f-aa58-85389970dcf7-/root/cache/go-build,target=/root/.cache/go-build go build -o out #14 0.723 no Go files in /app #14 ERROR: process "/bin/bash -ol pipefail -c go build -o out" did not complete successfully: exit code: 1 ----- [stage-0 8/8] RUN --mount=type=cache,id=s/8f06eb4a-56be-4f8f-aa58-85389970dcf7-/root/cache/go-build,target=/root/.cache/go-build go build -o out: 0.723 no Go files in /app ----- Dockerfile:23 ------------------- 21 | # build phase 22 | COPY . /app/. 23 | >>> RUN --mount=type=cache,id=s/8f06eb4a-56be-4f8f-aa58-85389970dcf7-/root/cache/go-build,target=/root/.cache/go-build go build -o out 24 | 25 | ------------------- ERROR: failed to solve: process "/bin/bash -ol pipefail -c go build -o out" did not complete successfully: exit code: 1 Error: Docker build failed
No description
9 Replies
Percy
Percy6mo ago
Project ID: 8f06eb4a-56be-4f8f-aa58-85389970dcf7,8f06eb4a-56be-4f8f-aa58-85389970dcf7,8f06eb4a-56be-4f8f-aa58-85389970dcf7
Fragly
Fragly6mo ago
What does your file-tree look like?
Ibodulla
IbodullaOP6mo ago
like this
No description
Fragly
Fragly6mo ago
You have no Go files in your root directory by default Go tries checking for Go files in the root directory but since there isn't any it fails I believe you'll need to specify the directory containing your Go files for your build command ( you can specify a custom build command in service settings )
Ibodulla
IbodullaOP6mo ago
my main.go files located in cmd folder so i have to change it. Am i right?
Fragly
Fragly6mo ago
I think so, I don't actually use Go at all - but based on a quick google search that seems like the correct solution
go build /app/cmd
go build /app/cmd
Joshie
Joshie6mo ago
The only reason you have to change, is becuase you don't have a build script. So it just defaults to the most common structure. You can either match that structure, or you can add a build script (a Dockerfile, a nixpacks file, or even a railway.json file)
Brody
Brody6mo ago
you can also simply update the build command in your service settings
Ibodulla
IbodullaOP6mo ago
thank you so much. I am so happy
Want results from more Discord servers?
Add your server