Docker provider cannot find local images

141 views
Skip to first unread message

Luca Da Rin Fioretto

unread,
Sep 22, 2015, 10:09:01 PM9/22/15
to Vagrant
Seems that Vagrant cannot find Docker's local images. I'm running Vagrant 1.7.4 on OS X.

If I try to set up and run a container based on my pre-built image base_distro,Vagrant returns an error. Below all the steps of my experiment:

Docker local images:
$ docker images
REPOSITORY          TAG                 IMAGE ID            CREATED             VIRTUAL SIZE
base_distro         latest              b827fd9613c7        9 days ago          1.727 GB
ubuntu              trusty              91e54dfb1179        4 weeks ago         188.4 MB

Vagrant file:
Vagrant.configure(2) do |config|
 config.ssh.insert_key = false
 config.vm.synced_folder ".", "/vagrant", disabled: true
 
 config.vm.provider "docker" do |d|
   d.image = "base_distro"
 end


Vagrant up:
$ vagrant up
Bringing machine 'default' up with 'docker' provider...
==> default: Docker host is required. One will be created if necessary...
   default: Vagrant will now create or start a local VM to act as the Docker
   default: host. You'll see the output of the `vagrant up` for this VM below.
   default:
   default: Importing base box 'hashicorp/boot2docker'...
   default: Matching MAC address for NAT networking...
   default: Checking if box 'hashicorp/boot2docker' is up to date...
   default: Setting the name of the VM: docker-host_default_1442971381537_93562
   default: Clearing any previously set network interfaces...
   default: Preparing network interfaces based on configuration...
   default: Adapter 1: nat
   default: Forwarding ports...
   default: 2375 => 2375 (adapter 1)
   default: 22 => 2222 (adapter 1)
   default: Running 'pre-boot' VM customizations...
   default: Booting VM...
   default: Waiting for machine to boot. This may take a few minutes...
   default: SSH address: 127.0.0.1:2222
   default: SSH username: docker
   default: SSH auth method: password
   default: Warning: Connection timeout. Retrying...
   default: Machine booted and ready!
==> default: Warning: When using a remote Docker host, forwarded ports will NOT be
==> default: immediately available on your machine. They will still be forwarded on
==> default: the remote machine, however, so if you have a way to access the remote
==> default: machine, then you should be able to access those ports there. This is
==> default: not an error, it is only an informational message.
==> default: Creating the container...
   default:   Name: Vagrant-Docker_default_1442971406
   default:  Image: base_distro
A Docker command executed by Vagrant didn't complete successfully!
The command run along with the output from the command is shown
below.

Command: "docker" "run" "--name" "Vagrant-Docker_default_1442971406" "-d" "base_distro"

Stderr: Unable to find image 'base_distro:latest' locally
Pulling repository base_distro
Error: image library/base_distro:latest not found

Stdout:

Note that if I run docker run manually it works:
$ docker run --name Vagrant-Docker_default_1442971406 -d base_distro
2180beed18b06c5e18c444a81bdfd57df4861643650d88236484b6ac322231e3



What am I missing?

Alvaro Miranda Aguilera

unread,
Sep 23, 2015, 4:48:48 AM9/23/15
to vagra...@googlegroups.com
what os is your host?

vagrant is creating a boot2docker vm, and inside that vm the image is not there
> --
> This mailing list is governed under the HashiCorp Community Guidelines -
> https://www.hashicorp.com/community-guidelines.html. Behavior in violation
> of those guidelines may result in your removal from this mailing list.
>
> GitHub Issues: https://github.com/mitchellh/vagrant/issues
> IRC: #vagrant on Freenode
> ---
> You received this message because you are subscribed to the Google Groups
> "Vagrant" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to vagrant-up+...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/vagrant-up/6ecc3d6f-d3ce-4b5b-b78d-6fb4ef6b3f86%40googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.

Luca Da Rin Fioretto

unread,
Sep 23, 2015, 9:39:07 AM9/23/15
to Vagrant
Right, for a moment I forgot to be in OS X.

Thank you very much!
Reply all
Reply to author
Forward
0 new messages