provider/docker: Fix Repository in PullOptions #2619
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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:
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):
I created an acceptance test that does not pass without this change against google docker registry. Tested against docker 1.7.