Parcourir la source

dockerhub push/pull should work now

Mohammed Nafees il y a 3 ans
Parent
commit
e010cf9b9f
2 fichiers modifiés avec 8 ajouts et 6 suppressions
  1. 3 5
      cli/cmd/connect/dockerhub.go
  2. 5 1
      cli/cmd/docker/agent.go

+ 3 - 5
cli/cmd/connect/dockerhub.go

@@ -22,21 +22,19 @@ func Dockerhub(
 
 	// query for dockerhub name
 
-	repoName, err := utils.PromptPlaintext(fmt.Sprintf(`Provide the Docker Hub image path, in the form of ${org_name}/${repo_name}. For example, porter1/porter.
-Image path: `))
+	repoName, err := utils.PromptPlaintext("Provide the Docker Hub organization name. For example, if your Docker Hub repository is 'myorg/myrepo', enter 'myorg'.\nName: ")
 
 	if err != nil {
 		return 0, err
 	}
 
-	username, err := utils.PromptPlaintext(fmt.Sprintf(`Docker Hub username: `))
+	username, err := utils.PromptPlaintext("Docker Hub username: ")
 
 	if err != nil {
 		return 0, err
 	}
 
-	password, err := utils.PromptPassword(`Provide the Docker Hub personal access token.
-Token:`)
+	password, err := utils.PromptPassword("Provide the Docker Hub personal access token.\nToken: ")
 
 	if err != nil {
 		return 0, err

+ 5 - 1
cli/cmd/docker/agent.go

@@ -401,7 +401,7 @@ func (a *Agent) getPushOptions(image string) (types.ImagePushOptions, error) {
 }
 
 func GetServerURLFromTag(image string) (string, error) {
-	named, err := reference.ParseNamed(image)
+	named, err := reference.ParseNormalizedNamed(image)
 
 	if err != nil {
 		return "", err
@@ -432,6 +432,10 @@ func GetServerURLFromTag(image string) (string, error) {
 		return "", err
 	}
 
+	if domain == "docker.io" {
+		domain = "index.docker.io"
+	}
+
 	return fmt.Sprintf("%s/%s", domain, nonImagePath), nil
 }