-
Notifications
You must be signed in to change notification settings - Fork 9
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add go example #171
Add go example #171
Conversation
templates/go/Dockerfile
Outdated
FROM golang:1.22-bookworm as builder | ||
|
||
WORKDIR /app | ||
|
||
COPY go.* ./ | ||
RUN go mod download | ||
COPY . ./ | ||
|
||
RUN CGO_ENABLED=0 go build -v -o server | ||
|
||
FROM alpine | ||
COPY --from=builder /app/server /app/server | ||
|
||
CMD ["/app/server"] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe just use ko
for docker images? https://github.com/ko-build/ko
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
idk, people can use that if they want but probably a dockerfile is what people are most likely to expect in a template?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
but probably a dockerfile is what people are most likely to expect in a template?
I can't tell if they would expect a Dockerfile, I think it's sufficient to give people one way to build a container image. The reason I suggested ko is that is so much common those days, it's used even in some of the cncf build pipelines, and it's literally one command to write down in the README. But if you wanna go with the dockerfile, i'm ok with it.
No description provided.