(ctx context.Context, pkgJSON PackageJSONV1, dockerToken string, insecureSkipVerify bool)
| 562 | } |
| 563 | |
| 564 | func pushManifest(ctx context.Context, pkgJSON PackageJSONV1, dockerToken string, insecureSkipVerify bool) error { |
| 565 | imageName, repository, err := getManifestParams(pkgJSON.SupportedTargets[0].DockerImageTag) |
| 566 | if err != nil { |
| 567 | return err |
| 568 | } |
| 569 | |
| 570 | manifestService, err := getManifestService(ctx, imageName, repository, dockerToken, insecureSkipVerify) |
| 571 | if err != nil { |
| 572 | return err |
| 573 | } |
| 574 | |
| 575 | manifestList, err := getManifestList(ctx, manifestService, pkgJSON) |
| 576 | if err != nil { |
| 577 | return err |
| 578 | } |
| 579 | |
| 580 | digest, err := manifestService.Put(ctx, manifestList, distribution.WithTag(pkgJSON.Version)) |
| 581 | if err != nil { |
| 582 | return fmt.Errorf("failed to create Docker manifest: %v", err) |
| 583 | } |
| 584 | fmt.Println("Created manifest:", digest.String()) |
| 585 | return nil |
| 586 | } |
| 587 | |
| 588 | func PublishToDockerRegistry(ctx context.Context, token, distDir string, pkgJSON PackageJSONV1, popts Opts) error { |
| 589 | // We use a mix of the Docker Go SDK that implements the Docker Engine API https://docs.docker.com/engine/api/latest/ |
no test coverage detected