Hey All,
Have the following func:
func pushImage(ctx context.Context, base []*dagger.Container, props BuildProps, sourceUserName string, sourcePassword *dagger.Secret) (string, error) {
platformVariants := make([]*dagger.Container, 0, len(base))
for _, container := range base {
var dir = container.Directory("/src/sample-app/target/")
var files, _ = dir.Glob(ctx, "**/*.jar")
var perms = dagger.ContainerWithFileOpts{
Owner: "1000:0",
}
var platform, platformErr = container.Platform(ctx)
if platformErr != nil {
log.Fatal(platformErr)
}
var repo = strings.Split(props.AppContainer, "/")[0]
// select output directory
var prodImage = dag.Container(dagger.ContainerOpts{Platform: platform}).
WithRegistryAuth(repo, sourceUserName, sourcePassword).
From(fmt.Sprintf("%s:%s", props.AppContainer, props.AppVersion))
But for the life of me cant get it to work:
[2025-08-20T05:03:16.482Z] 44 : ┆ ┆ resolving xx.docker.io.xxx.com/server-core:4.50.3 ERROR [0.6s]
[2025-08-20T05:03:16.482Z] 44 : ┆ ┆ ! failed to authorize: failed to fetch anonymous token: unexpected status from GET request to https://xx.docker.io.xx.com:443/artifactory/api/docker/xx/v2/token?scope=repository%3Aserver-core%3Apull&service=xx.docker.io.xx.com%3A443: 401