Skip to content

Commit

Permalink
Obey alternate registry settings for Docker auth (#3947)
Browse files Browse the repository at this point in the history
  • Loading branch information
jsierles authored Sep 17, 2024
1 parent b4d50e8 commit c4e44d4
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions internal/build/imgsrc/docker.go
Original file line number Diff line number Diff line change
Expand Up @@ -636,17 +636,20 @@ func clearDeploymentTags(ctx context.Context, docker *dockerclient.Client, tag s
}

func registryAuth(token string) registry.AuthConfig {
targetRegistry := viper.GetString(flyctl.ConfigRegistryHost)
return registry.AuthConfig{
Username: "x",
Password: token,
ServerAddress: "registry.fly.io",
ServerAddress: targetRegistry,
}
}

func authConfigs(token string) map[string]registry.AuthConfig {
targetRegistry := viper.GetString(flyctl.ConfigRegistryHost)

authConfigs := map[string]registry.AuthConfig{}

authConfigs["registry.fly.io"] = registryAuth(token)
authConfigs[targetRegistry] = registryAuth(token)

dockerhubUsername := os.Getenv("DOCKER_HUB_USERNAME")
dockerhubPassword := os.Getenv("DOCKER_HUB_PASSWORD")
Expand Down

0 comments on commit c4e44d4

Please sign in to comment.