maier / vagrant-alpine

Vagrant plugin for Alpine Linux Guest
MIT License
137 stars 10 forks source link

Problem with Docker Provisioner #26

Open jamiejackson opened 7 years ago

jamiejackson commented 7 years ago

I assumed I'd be able to build an image with the Docker provisioner. Bad assumption?

...
==> db_master: Setting hostname...
==> db_master: Configuring and enabling network interfaces...
==> db_master: Installing NFS client...
==> db_master: Exporting NFS shared folders...
==> db_master: Preparing to edit /etc/exports. Administrator privileges will be required...
==> db_master: Mounting NFS shared folders...
==> db_master: Running provisioner: docker...
    db_master: Installing Docker onto machine...
Vagrant attempted to execute the capability 'docker_install'
on the detect guest OS 'alpine', but the guest doesn't
support that capability. This capability is required for your
configuration of Vagrant. Please either reconfigure Vagrant to
avoid this capability or fix the issue by creating the capability.

Vagrantfile

Vagrant.configure("2") do |config|

  config.vbguest.auto_update = false
  config.vm.synced_folder ".", "/vagrant", type: "nfs"

  config.vm.provision "docker" do |d|
    d.build_image "/vagrant/5.7"
  end

  config.vm.define "db_master" do |web|
    web.vm.box = "maier/alpine-3.6-x86_64"
    web.vm.hostname = 'db_master'

    web.vm.network :private_network, ip: "192.168.56.101"

    web.vm.provider :virtualbox do |v|
      v.customize ["modifyvm", :id, "--natdnshostresolver1", "on"]
      v.customize ["modifyvm", :id, "--memory", 512]
      v.customize ["modifyvm", :id, "--name", "db_master"]
    end
  end

  config.vm.define "db_slave" do |db|
    db.vm.box = "maier/alpine-3.6-x86_64"
    db.vm.hostname = 'db_slave'

    db.vm.network :private_network, ip: "192.168.56.102"

    db.vm.provider :virtualbox do |v|
      v.customize ["modifyvm", :id, "--natdnshostresolver1", "on"]
      v.customize ["modifyvm", :id, "--memory", 512]
      v.customize ["modifyvm", :id, "--name", "db_slave"]
    end
  end
end
maier commented 7 years ago

Not sure what a 'docker provisioner' is, must be a new vagrant feature. I'll need to read up on it.

jamiejackson commented 7 years ago

FYI: https://www.vagrantup.com/docs/provisioning/docker.html

It was introduced in Vagrant 1.4 (2013).

maier commented 7 years ago

Never noticed it... Looking into what is needed.

jamiejackson commented 7 years ago

Maybe it's Vagrant, itself, which needs to accommodate it:

maier commented 7 years ago

Yeah, I found that as well. The support for installing is in the provisioner itself not the guest. I'm going to try adding the capabilities to the guest to see if the provisioner can use them.