title: Provisioning vagrant machine: The Dockerfile (Dockerfile) must be within the build context
body: <p>I'm trying to build a docker container on the fly in a vagrant vm. The Vagrantfile and Dockerfile the container is to be built from are in the same directory, and on the VM, they are both found in the default synced folder /vagrant as expected. Unfortunately, building the container does not work- I get <code>The Dockerfile (Dockerfile) must be within the build context</code>. What is the proper build context in this case? Do I need to copy the Dockerfile somewhere to be able to use it?</p>
  
  <p>Vagrantfile:</p>
  
  <pre><code>Vagrant.configure("2") do |config|
      config.vm.provider "virtualbox"
      config.vm.box = "ubuntu/trusty64"
      config.vm.hostname = "ubuntu"
  
      config.vm.network :private_network, ip: "192.168.0.200"
      config.ssh.forward_agent = true
      config.ssh.insert_key = false
  
      config.vm.provision "docker" do |d|
          d.build_image "/vagrant/Dockerfile"
          d.build_args = ['--tag "container"']
          d.run "container"
      end
  end
  </code></pre>
  
  <p>Output:</p>
  
  <pre><code>$ vagrant provision
  ==&gt; default: Running provisioner: docker...
  ==&gt; default: Building Docker images...
  ==&gt; default: -- Path: /vagrant/Dockerfile
  ==&gt; default: stdin: is not a tty
  ==&gt; default: The Dockerfile (Dockerfile) must be within the build context (/vagrant/Dockerfile)
  The following SSH command responded with a non-zero exit status.
  Vagrant assumes that this means the command failed!
  
  docker build  /vagrant/Dockerfile
  
  Stdout from the command:
  
  
  
  Stderr from the command:
  
  stdin: is not a tty
  The Dockerfile (Dockerfile) must be within the build context (/vagrant/Dockerfile)
  </code></pre>