Skip to content

Commit

Permalink
chore: send auth token
Browse files Browse the repository at this point in the history
  • Loading branch information
smrz2001 committed Jun 5, 2023
1 parent 24326e4 commit 4fc406a
Showing 1 changed file with 32 additions and 0 deletions.
32 changes: 32 additions & 0 deletions ci/cmd/build/main.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
package main

import (
"context"
"fmt"
"os"

"dagger.io/dagger"
)

func main() {
ctx := context.Background()

// Initialize Dagger client
client, err := dagger.Connect(ctx, dagger.WithLogOutput(os.Stdout))
if err != nil {
panic(err)
}
defer client.Close()

contextDir := client.Host().Directory(".")

ref, err := contextDir.
DockerBuild().
WithRegistryAuth().
Publish(ctx, fmt.Sprintf("ttl.sh/hello-dagger-%.0f")) //#nosec
if err != nil {
panic(err)
}

fmt.Printf("Published image to :%s\n", ref)
}

0 comments on commit 4fc406a

Please sign in to comment.