Skip to content

Instantly share code, notes, and snippets.

@svjunic
Last active August 29, 2015 14:27
Show Gist options
  • Save svjunic/706f5bc224cc127ddb07 to your computer and use it in GitHub Desktop.
Save svjunic/706f5bc224cc127ddb07 to your computer and use it in GitHub Desktop.

vagrantとdockerの環境作るめも

参考サイト:http://qiita.com/hidekuro/items/fc12344d36d996198e96#3-8

関連コマンドインストール

caskはGUIのツールをコマドラインで実行するもの

brew install caskroom/cask/brew-cask
brew cask install virtualbox

vagrant インストール

brew cask install vagrant

vagrant 設定ファイル作成

vagrant init --minimal ubuntu/trusty64

Vagrantfileに追記

Vagrant.configure(2) do |config|
  config.vm.box = "ubuntu/trusty64"
  config.vm.provider "virtualbox" do |v|
    v.customize ["modifyvm", :id, "--ostype", "Ubuntu_64"]
     v.name = "ubuntu/trusty64"
     v.cpus = 2
     v.memory = 1024
  end
end

Vagrantfileから仮想環境作成ー起動

ここで勝手にatlasからboxを落としてきてくれる https://atlas.hashicorp.com/ アカウント作っちゃったけど必要なかったかも box add NAME URLなんとかーは不要 時間がかかる

vagrant up

VMにsshで接続

vagrant ssh

VM終了

vagrant halt

VM休止

vagrant suspend

VM削除

vagrant destroy
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment