R
Railway11mo ago
Peter

Running Go server with kafka

I am trying to deploy a go project with the confluent-kafka-go package. However, when I tried to deploy with the nixpacks defaults i got errors where kafka was undefined. Digging a bit deeper i found this is because https://nixpacks.com/docs/providers/go CGO is set to 0 and needs to be 1 because the kafka client is C. When i set CGO_ENABLED=1 in env variables I get the following issue: "cgo: C compiler "gcc" not found: exec: "gcc": executable file not found in $PATH" Any help would be appreciated ❤️
Solution:
add a nixpacks.toml file with this in it to install gcc
[phases.setup]
nixPkgs = ['...', 'gcc']
[phases.setup]
nixPkgs = ['...', 'gcc']
...
Jump to solution
5 Replies
Percy
Percy11mo ago
Project ID: c478d6b9-aa18-44b2-b287-fe933203a122
Peter
PeterOP11mo ago
c478d6b9-aa18-44b2-b287-fe933203a122
Solution
Brody
Brody11mo ago
add a nixpacks.toml file with this in it to install gcc
[phases.setup]
nixPkgs = ['...', 'gcc']
[phases.setup]
nixPkgs = ['...', 'gcc']
Peter
PeterOP11mo ago
Thanks ❤️ that worked
Brody
Brody11mo ago
awsome!
Want results from more Discord servers?
Add your server