Skip to content
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

when deploying a Turbine application, we should rely on local go version creating the dockerfile #838

Open
raulb opened this issue Oct 25, 2023 · 0 comments
Labels
bug Something isn't working

Comments

@raulb
Copy link
Member

raulb commented Oct 25, 2023

Describe the bug

In https://github.com/meroxa/cli/blob/main/cmd/meroxa/turbine/golang/templates/Dockerfile.tpl#L1C16-L1C25, we rely on the go version specified in https://github.com/meroxa/cli/blob/main/cmd/meroxa/turbine/golang/deploy.go#L29. If the go version doesn't match user's local go version, building the image through apps deploy will fail:

[2023-10-25T08:44:52Z]	"#11 [builder 4/4] RUN go build -tags server -o app-name ./...\n"
[2023-10-25T08:44:58Z]	"#11 6.377 go: errors parsing go.mod:\n"
[2023-10-25T08:44:58Z]	"#11 6.377 /builder/go.mod:3: invalid go version '1.21.0': must match format 1.23\n"
[2023-10-25T08:44:58Z]	"#11 ERROR: process \"/bin/sh -c go build -tags server -o app-name ./...\" did not complete successfully: exit code: 1\n"
[2023-10-25T08:44:58Z]	"------\n"
[2023-10-25T08:44:58Z]	" > [builder 4/4] RUN go build -tags server -o app-name ./...:\n"
[2023-10-25T08:44:58Z]	"6.377 go: errors parsing go.mod:\n"
[2023-10-25T08:44:58Z]	"6.377 /builder/go.mod:3: invalid go version '1.21.0': must match format 1.23\n"
[2023-10-25T08:44:58Z]	"------\n"
[2023-10-25T08:44:58Z]	"Dockerfile:5\n"
[2023-10-25T08:44:58Z]	"--------------------\n"
[2023-10-25T08:44:58Z]	"   3 |     COPY . .\n"
[2023-10-25T08:44:58Z]	"   4 |     ENV CGO_ENABLED=0 GOOS=linux GOARCH=amd64\n"
[2023-10-25T08:44:58Z]	"   5 | >>> RUN go build -tags server -o app-name ./...\n"
[2023-10-25T08:44:58Z]	"   6 |     \n"
[2023-10-25T08:44:58Z]	"   7 |     FROM [gcr.io/distroless/static](http://gcr.io/distroless/static)\n"
[2023-10-25T08:44:58Z]	"--------------------\n"
[2023-10-25T08:44:58Z]	"error: failed to solve: process \"/bin/sh -c go build -tags server -o app-name ./...\" did not complete successfully: exit code: 1\n"

To Reproduce

What can we do to reproduce your bug?

Try to deploy an app using a different go version than the one we've got in CLI.

Expected behavior

We fetch local go version and use that one instead of a hardcoded one.

@raulb raulb added the bug Something isn't working label Oct 25, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant