R
Railway13mo ago
quobix

nixpacks golang 1.21

Hello, I must be doing something wrong, but I can't figure out what. I use nixpacks to build my golang project direct from github. I there is 1.21 support I would assume, but I can't seem to get it to work, I am just bombarded with this every build #14 0.821 note: imported by a module that requires go 1.21 I can't seem to find docs, or help on this. Can anyone help me?
16 Replies
Percy
Percy13mo ago
Project ID: 8b65bc59-c608-44df-ab70-9144def6685a
Brody
Brody13mo ago
add a nixpacks.toml to your project with this in it
[phases.setup]
nixpkgsArchive = '8ed712ec90468c931713e5ec60bd9e6678daf8a8'
[phases.setup]
nixpkgsArchive = '8ed712ec90468c931713e5ec60bd9e6678daf8a8'
reference: https://github.com/NixOS/nixpkgs/commit/8ed712ec90468c931713e5ec60bd9e6678daf8a8
quobix
quobixOP13mo ago
I created a nixpacks.toml in the root of my project, and pasted in this exact data. Still get the same message, where else would I create the nixpacks.toml file?
Brody
Brody13mo ago
is your service set to use the root directory?
quobix
quobixOP13mo ago
yes
No description
No description
Brody
Brody13mo ago
im asking about a service setting in railway
quobix
quobixOP13mo ago
yes
No description
Brody
Brody13mo ago
use a Dockerfile instead
FROM golang:1.21.4-alpine3.18

WORKDIR /app

COPY go.mod go.sum ./

RUN go mod download

COPY . ./

RUN go build -o main

ENTRYPOINT ["/app/main"]
FROM golang:1.21.4-alpine3.18

WORKDIR /app

COPY go.mod go.sum ./

RUN go mod download

COPY . ./

RUN go build -o main

ENTRYPOINT ["/app/main"]
quobix
quobixOP13mo ago
Does this mean I’m not doing something wrong?
Brody
Brody13mo ago
not that I know of
quobix
quobixOP13mo ago
Ok, thank you.
Brody
Brody13mo ago
so let me know if that dockerfile works for you
quobix
quobixOP13mo ago
I’ll try it out asap. Thanks for your help! yeah, moving to docker works. Probably a better idea anyway. Thanks for unblocking me. Choo Choo!
Brody
Brody13mo ago
choo choo!
Want results from more Discord servers?
Add your server