I tried to push the docker image the way this link does.
https://docs.dagger.io/730264/quickstart-publish/#publish-the-application
However, it fails with the following error.
unable to load default labels: repository does not exist
Post "http://dagger/query": dial tcp 127.0.0.1:35859: connect: connection refused
Please visit https://dagger.io/help#go for troubleshooting guidance.
exit status 1
How can I resolve this error?
This is my code.
func main() {
ctx := context.Background()
client, err := dagger.Connect(ctx, dagger.WithLogOutput(os.Stdout))
if err != nil {
return nil, err
}
defer client.Close()
src := client.Host().Directory("./sample-app")
image := client.Container().Build(src)
resp, err := image.Publish(ctx, fmt.Sprintf("ttl.sh/sample-dagger-%.0f", math.Floor(rand.Float64()*10000000)))
fmt.Println(resp)
if err != nil {
fmt.Println(err)
os.Exit(1)
}
}