boot2dockerでvagrant share使ってみた

More than 3 years have passed since last update.


スクリーンショット 2014-09-03 9.44.49.png


  • Vagrant, Virtualboxをインストールしておく。

  • Virtualbox guest additionsが含まれているVagrant Cloudイメージを使う。

git clone

cd boot2docker-vagrant-box



+ config.vm.synced_folder ENV['HOME'], "/vagrant_data"

+ :forwarded_port, guest: 80, host: 8080


vagrant up

vagrant ssh
docker run \
--name=wordpress4 \
-it -d \
-p 80:80 \
-v /vagrant_data:/root \
tukiyo3/ubuntu-debootstrap-ja:14.04-wordpress4 \

  • /vagrant_data/ を /root/にマウントする場合の例。

vagrant share用設定

vagrant login

$ vagrant login

In a moment we'll ask for your username and password to Vagrant Cloud.
After authenticating, we will store an access token locally. Your
login details will be transmitted over a secure connection, and are
never stored on disk locally.

If you don't have a Vagrant Cloud account, sign up at

Username or Email: tukiyo3
Password (will be hidden):
You're now logged in!

vagrant share

$ vagrant share --http=8080

==> default: Detecting network information for machine...
default: Local machine address:
default: Note: With the local address (, Vagrant Share can only
default: share any ports you have forwarded. Assign an IP or address to your
default: machine to expose all TCP ports. Consult the documentation
default: for your provider ('virtualbox') for more information.
default: Local HTTP port: 8080
default: Local HTTPS port: disabled
default: Port: 2201
default: Port: 2200
default: Port: 8080
==> default: Checking authentication and authorization...
==> default: Creating Vagrant Share session...
default: Share will be at: fantastic-crow-4926
==> default: Your Vagrant Share is running! Name: fantastic-crow-4926
==> default: URL:
==> default:
==> default: You're sharing your Vagrant machine in "restricted" mode. This
==> default: means that only the ports listed above will be accessible by
==> default: other users (either via the web URL or using `vagrant connect`).

(このURLはvagrant shareを実行するたびに変更される。)