Golang Template
Hi there, does anyone have a golang template with go version 1.22 or 1.23?
The base golang image from coder has a too old version for me and I haven't figured out yet how to install a newer version in the coder workspace
Thanks in advance!
25 Replies
<#1287055973424300083>
Category
Help needed
Product
Coder OSS (v2)
Platform
Linux
Logs
Please post any relevant logs/error messages.
I have added this to my template which works BUT i always need to when conncting which is a bit annoying
hi @RainyDev, which template are you using?
https://github.com/sharkymark/v2-templates/tree/main/src/docker-intellij-gateway
I think it was that one that I modified a bit (added go install script etc but didnt quite work)
GitHub
v2-templates/src/docker-intellij-gateway at main · sharkymark/v2-te...
Coder CDE Terraform templates and tips. Contribute to sharkymark/v2-templates development by creating an account on GitHub.
i see
I would recommend starting over with our Docker template and adding our JetBrains Gateway module to it
that way you actually control the Dockerfile that is used within the workspace :-)
Will that work on Kubernetes?
Sorry havent digged too deep into Coder yet
oh sory, did not know you were using Kubernetes
Yeah, sorry 😄
you probably did not use this one then
since it's for IntelliJ on Docker
Oh no i wasn't sorry
picked the wrong one one moment please
GitHub
v2-templates/src/pod-gateway-lang/main.tf at main · sharkymark/v2-t...
Coder CDE Terraform templates and tips. Contribute to sharkymark/v2-templates development by creating an account on GitHub.
It was that one I think
oh alright
And the go version there is too low for my required go modules
I need 1.22 at least and 1.23.1 would be optimal
yeah so in that case honestly just reuse the template but make it use your own image
do you have any CI/CD setup?
I do have gitea hosted with CI, yes. But honestly I haven't digged too deep into creating images for coder 😄
Is there any docs on that?
I don't really think there is
so what you'll want to do is either create a Dockerfile that calls
FROM <image>
(where <image> is the image used in your template) and updates it.
or look into how to make your own image from scratch and install Go there
https://github.com/coder/coder/blob/main/examples/templates/docker/build/Dockerfile
then push the resulting image to a registry (I think Gitea has one) and edit the template to pull that image insteadHmm okay, I'll have to look into this. Thanks tho!
otherwise using devcontainers might be easier
i've got to go but feel free to ask any questions and i'll answer them when I come back
Alright, thank you so much 🙂
hey @RainyDev, any luck?
nop unfortunately not really
do you need any help?
I guess not really
But thanks!
I‘ll let you know in case I do
@Phorcys closed the thread.