diff --git a/CHANGELOG.md b/CHANGELOG.md index db99c39eb30..5823aeea6cf 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,6 +10,9 @@ IMPROVEMENTS: * env: Default interpolation of optional meta fields of parameterized jobs to an empty string rather than the field key. [[GH-3720](https://github.com/hashicorp/nomad/issues/3720)] +BUG FIXES: + * driver/docker: Fix docker credential helper support [[GH-3818](https://github.com/hashicorp/nomad/issues/3818)] [[GH-4221](https://github.com/hashicorp/nomad/issues/4221)] + ## 0.8.3 (April 27, 2018) BUG FIXES: diff --git a/client/driver/docker.go b/client/driver/docker.go index cc31e547eae..d6a32601728 100644 --- a/client/driver/docker.go +++ b/client/driver/docker.go @@ -2130,13 +2130,15 @@ func authFromHelper(helperName string) authBackend { helper := dockerAuthHelperPrefix + helperName cmd := exec.Command(helper, "get") - // Ensure that the HTTPs prefix exists - if !strings.HasPrefix(repo, "https://") { - repo = fmt.Sprintf("https://%s", repo) + repoInfo, err := parseRepositoryInfo(repo) + if err != nil { + return nil, err } - cmd.Stdin = strings.NewReader(repo) + // Ensure that the HTTPs prefix exists + repoAddr := fmt.Sprintf("https://%s", repoInfo.Hostname()) + cmd.Stdin = strings.NewReader(repoAddr) output, err := cmd.Output() if err != nil { switch err.(type) {