Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

provider/docker: Fix Repository in PullOptions #2619

Merged
merged 2 commits into from
Oct 7, 2015
Merged

Conversation

Nomon
Copy link

@Nomon Nomon commented Jul 3, 2015

0558763 breaks pulling images from private registries. The docker api client/daemon expects the whole image name including the registry as Repository attribute in pull options (as in "private.registry.com:port/image" as the image name not just "image"). Currently if you do a docker_image resource with name = "private.registry.com:port/image:tag" it will create the following pulloptions:

&PullOptions{
  Registry: "private.registry.com:port",
  Tag: "tag",
  Repository: "image"
}

This tries to pull image called library/image:tag from default docker registry and the pull will fail with error message:
Unable to read Docker image into resource: Unable to pull image private.registry.com:port/image:tag: Error pulling image private.registry.com:port/image:tag: Error: image library/image:tag not found.

The correct pull options would be (and what the previous version of pullImage did):

&PullOptions{
  Registry: "private.registry.com:port",
  Tag: "tag",
  Repository: "private.registry.com:port/image"
}

I created an acceptance test that does not pass without this change against google docker registry. Tested against docker 1.7.

@Nomon Nomon changed the title Fix Repository in docker client PullOptions for private registries provider/docker: Fix Repository in PullOptions Jul 3, 2015
@ghost
Copy link

ghost commented Aug 17, 2015

Seeing this issue in Terraform v0.6.3.

@josephholsten
Copy link
Contributor

@phinze 👀, has a test

@phinze
Copy link
Contributor

phinze commented Oct 7, 2015

Sorry for the delay on this - @rvm2015 - looks great! Thank you! 👍

phinze added a commit that referenced this pull request Oct 7, 2015
provider/docker: Fix Repository in PullOptions
@phinze phinze merged commit 5d9a572 into hashicorp:master Oct 7, 2015
@ghost
Copy link

ghost commented Apr 30, 2020

I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues.

If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@ghost ghost locked and limited conversation to collaborators Apr 30, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants