I am trying to setup some ci jobs using the go sdk, I want to build a local docker image for when working with the jobs locally so I can have all the go modules cached. Reasons for this:
- my local go mod cache is massive so using mounting it takes forever
- my internet is horribly slow so every time I want to run the job it takes forever to download the image
- my internet is horribly slow so pushing up the built cache image to a registry takes forever and then takes forever to download
My code currently looks like:
client, err := dagger.Connect(ctx)
if err != nil {
return err
}
defer client.Close()
client.Container()
src := client.Host().Directory(".")
container := client.Container().
From("golang:1.21").
WithDirectory("/src", src).
WithWorkdir("/src")
But I would like to instead use a container from image go_cache:latest that only exists on my local. It always seems to want to pull from a registry and I so far have not found a way to configure it to allow this. I hope I am just overlooking something simple in the documentation.