LoginSignup
15
14

More than 5 years have passed since last update.

Vagrant + docker + Parallelsを試す

Last updated at Posted at 2014-12-29

Vagrantのダウンロード

以下からダウンロードできるのでこれをダウンロードしてインストールする。
https://www.vagrantup.com/downloads.html

念のために、以下のコマンドでVersionを確認。

$ vagrant version                                                          [~/Develop/vagrant]
Installed Version: 1.6.5
Latest Version: 1.6.5

You're running an up-to-date version of Vagrant!

引き続き、Parallels用のPluginをインストールする

$ vagrant plugin install vagrant-parallels

dockerクライアントのインストール

brewを使ってインストールできるので、以下のコマンドで入れる。

$ brew install docker

boot2dockerの環境を作成する

以下のコマンドで、boot2docker用のVagrantfileが作成される

$ vagrant init parallels/boot2docker

直下に作成されるので任意のフォルダで実行することをおすすめする

起動

以下のコマンドで起動できる。

$ vagrant up --provider parallels

そして、以下のコマンドでDOCKER_HOSTを指定してやり、Dockerのコマンドから接続する

$ export DOCKER_HOST="tcp://`vagrant ssh-config | sed -n "s/[ ]*HostName[ ]*//gp"`:2375"

以下でクライアントから、サーバーに接続できていることが確認できた。

$ docker version
Client version: 1.3.1
Client API version: 1.15
Go version (client): go1.3.3
Git commit (client): 4e9bbfa
OS/Arch (client): darwin/amd64
Server version: 1.3.1
Server API version: 1.15
Go version (server): go1.3.3
Git commit (server): 4e9bbfa
15
14
0

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
15
14