Trouble using Go on agents

Hi all,

I’m new to BK, so I suspect I’m not understanding how things fundamentally work under the hood.

I’m wanting to use a pipeline to compile and deploy my Go code. I’ve added Go installation steps in the bootstrap script, which seems to process successfully according to elastic-stack Cloudwatch logs.

sudo dnf -y install golang

However, when the agent runs the command go version in my pipeline, it fails saying command not found.

Is this the correct way to use Go (or any other software) on agents? Or is there a more accepted way of doing things?

Hi @vowelalmost ,

Welcome to the Buildkite Support Community! :wave:

One approach that you can use it containerise your build. You can use a docker image with a specific Go version and use our docker plugin to load the environment that you need based on the docker image you want. You can read more about that in our docs here Containerized builds with Docker | Buildkite Documentation

If there’s any other issue you encounter, do give us a shoutout.

Cheers!

Thanks lizette, I’ll check that out!

What type of things would I use the bootstrap script for (rather than a container)?

Hey @vowelalmost , that’s a great question. the bootstrap script can be used to customise stack instances to avoid maintenance overhead on the AMI’s. We have a few customers use it in various ways too like pulling down container images, large repositories, etc to speed up build times.