5
8

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

最低限のCoreOSのVagrantfile

Posted at

本家のファイルを最低限動く程度まで削りました。
synced_folderにnfsを使用しているので、WindowsはVagrant WinNFSdをインストールしてください。

Vagrantfile
# -*- mode: ruby -*-
# # vi: set ft=ruby :

Vagrant.configure("2") do |config|
  config.ssh.insert_key = false
  config.vm.box = "coreos-alpha"
  config.vm.box_url = "https://storage.googleapis.com/alpha.release.core-os.net/amd64-usr/current/coreos_production_vagrant.json"

  config.vm.provider :virtualbox do |v|
    v.check_guest_additions = false
    v.functional_vboxsf     = false
    v.memory = 1024
    v.cpus = 1
  end

  if Vagrant.has_plugin?("vagrant-vbguest") then
    config.vbguest.auto_update = false
  end

  config.vm.network :private_network, :ip => "172.17.8.101"

  config.vm.synced_folder "host-side path", "guest-side path", :nfs => true, :mount_options => ["nolock,vers=3,udp"]
end

プロビジョニング時にDocker Composeをインストールするならこんな感じでしょうか。

Vagrantfile
# -*- mode: ruby -*-
# # vi: set ft=ruby :

Vagrant.configure("2") do |config|
  config.ssh.insert_key = false
  config.vm.box = "coreos-alpha"
  config.vm.box_url = "https://storage.googleapis.com/alpha.release.core-os.net/amd64-usr/current/coreos_production_vagrant.json"

  config.vm.provider :virtualbox do |v|
    v.check_guest_additions = false
    v.functional_vboxsf     = false
    v.memory = 1024
    v.cpus = 1
  end

  if Vagrant.has_plugin?("vagrant-vbguest") then
    config.vbguest.auto_update = false
  end

  config.vm.network :private_network, :ip => "172.17.8.101"
  
  config.vm.provision :shell, inline: <<-SHELL
    mkdir -p /opt/bin
    curl -L https://github.com/docker/compose/releases/download/1.12.0/docker-compose-`uname -s`-`uname -m` > /opt/bin/docker-compose
    chmod +x /opt/bin/docker-compose
  SHELL

  config.vm.synced_folder "host-side path", "guest-side path", :nfs => true, :mount_options => ["nolock,vers=3,udp"]
end
5
8
1

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
5
8

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?