Problems with using docker_image to pull an image

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
username: foo
password: bar

…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

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’ 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.