# Problems with using docker\_image to pull an image

**URL:** <https://forum.ansible.com/t/problems-with-using-docker-image-to-pull-an-image/23145>\
**Category:** Ansible Project\
**Tags:** ubuntu\
**Created:** [December 1, 2016, 12:33am UTC](https://forum.ansible.com/t/problems-with-using-docker-image-to-pull-an-image/23145 "2016-12-01T00:33:43Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Stefan\_Stefansson](https://avatars.discourse-cdn.com/v4/letter/s/b5ac83/32.png) [@Stefan\_Stefansson](https://forum.ansible.com/u/Stefan_Stefansson)\
**Post date:** [December 1, 2016, 12:33am UTC](https://forum.ansible.com/t/problems-with-using-docker-image-to-pull-an-image/23145/1 "2016-12-01T00:33:43Z")

</div>

Hi.

I’m trying to use docker\_image to pull an image from my private repository but I keep getting this error: “Get http://: http: no Host in request URL”.

Here is what my task list currently looks like:

docker\_login:  
registry: [our.docker.repo.com](http://our.docker.repo.com)  
username: foo  
password: bar

- name: pull docker-jenkins image  
docker\_image:  
name: “[our.docker.repo.com/jenkins:stfs](http://our.docker.repo.com/jenkins:stfs)”  
tag: “stfs”

…but I’ve tried all kinds of combinations of not specifying the tag in the “name” attribute, only specifying it there, specifying the “docker\_host” attribute, specifying the “repository” attribute but I can’t seem to get things working and I have no idea what the problem is.

I actually just now tried to change this to pull the official jenkinsci/jenkins image and I get the same error… so it doesn’t seem to be related to using private repositories.

Here is the error I’m getting after turning on verbose output: [https://gist.github.com/StFS/e275130e88c22233016282516a20b09a](https://gist.github.com/StFS/e275130e88c22233016282516a20b09a)

I also tried turning on the “don’t delete the temp files” and did the “explode” / “execute” thing and added print statements here and there and ended up finding out that the problem actually occurs inside the docker-py libraray but then I gave up and decided that maybe I should try asking here instead (I did try the IRC channel but got no answer).

Some “fun facts” I should mention:

- I’m using vagrant to test this
- I’m on Ubuntu using ansible 2.2.0.0
- The virtual machine being set up is CentOS 7  
Also, I logged into the vagrant machine via SSH and ran the docker commands corresponding to what I’m doing above (both ‘docker login’/‘docker pull [our.docker.repo.com/jenkins:stfs](http://our.docker.repo.com/jenkins:stfs)’ as well as just ‘docker pull jenkinsci/jenkins’ and they all worked fine.

Of course I’ve tried to google and I have found some hits for the literal string “Get http://: http: no Host in request URL” but they all refer to non-ansible things and I’ve been unable to figure out how to apply any solutions mentioned there to my particular circumstance.

So… can anybody think of anything I can do here?

Kind regards, Stefan Freyr.
