TL;DR with no $HOME/.docker/config.json and gnome-keyring not installed, dagger failed to pull public images
Hello, I am failing to run what seems like a pretty basic scenario, and I have even condensed it down to a minimal repro.
Goal: compile a go program using golang:1.22 using dagger.io/dagger v0.10.3
Expected:
- fetch the image
- mount my source
- compile it
- export executable to host filesystem
Actual:
12: resolve image config for docker.io/library/golang:1.22
12: > in from golang:1.22
12: resolve image config for docker.io/library/golang:1.22 ERROR: error getting credentials - err: exit status 1, out: `GDBus.Error:org.freedesktop.DBus.Error.ServiceUnknown: The name org.freedesktop.secrets was not provided by any .service files`
I have no issue running docker pull golang:1.22, so I don't believe I should have a dependency on any keychain/secrets.
EDIT: Even more minimal repro code:
dag.Container().From("golang:1.22").Export(context.Background(), "golang.tar")
This is my minimal code to reproduce the error:
package main
import (
"context"
"fmt"
"os"
"dagger.io/dagger"
)
func check(err error) {
if err != nil {
panic(err)
}
}
func main() {
client, err := dagger.Connect(context.Background(), dagger.WithLogOutput(os.Stderr))
check(err)
const buildImg = "golang:1.22"
src := client.Host().Directory(".")
build := client.Container().From(buildImg).WithMountedDirectory("/src", src)
ok, err := build.WithExec([]string{"go", "build",
"-o", "/app/demo",
"/src/main.go"}).
File("/app/demo").
Export(context.Background(), "demo")
check(err)
if ok {
fmt.Println("That was ok I guess")
} else {
fmt.Println("That was not ok")
}
fmt.Println("Compiled executable to ./demo")
}