xharrietのあれこれ。

日英翻訳 大絶賛独学中

Vagrant ~ GETTING STARTED

今日は『翻訳英文法』から少し反れた話題を。

Web系のプログラマに憧れて、少しだけPHPをかじってみたことがある。
その時に、ローカルPCに開発環境を立てる必要があったけれども全く無知だったのでgoogle先生に聞きながらVagrantとVirtualBoxを使って仮想マシンを入れましたとさ。

が、ネット上に転がっていた手順を真似したものの上手く動かず(参照してたサイトが使っていたPCがMacだった&私のPCがVistaだったのが大きいと思う。。)、途中で見つけたXAMPPに乗り換えた。

もうアンインストールしてしまったのだがずっと引っかかっていたので、Vagrantのドキュメントを英文で読みながら訳してみることにした。

趣味と実益を兼ねた取組み!(どっちが趣味かわからん・・・というかどっちも実益はないな)

まずは、「初めての方にお勧め」と書かれていた "GETTING STARTED" より。中身を知りたい気持ちが先行して、訳は若干いい加減ですが。。

原文と訳

The Vagrant getting started guide will walk you through your first Vagrant project, and show off the basics of the major features Vagrant has to offer.

このVagrant導入ガイドは、初めてVagrantプロジェクトを作るあなたのためにその手順を示しつつ、Vagrantが持つ主な特徴の基礎をご紹介します。

If you're curious what benefits Vagrant has to offer, you should also read the "Why Vagrant?" page.

Vagrantを使うことにどのような利点があるのかに興味があるのであれば、「なぜVagrantを選ぶのか?」のページも読むと良いでしょう。

The getting started guide will use Vagrant with VirtualBox, since it is free, available on every major platform, and built-in to Vagrant. After reading the guide though, don't forget that Vagrant can work with many other providers.

この導入ガイドでは、VagrantをVirtualBoxと共に使用します。VirtualBoxは無償で、主要なプラットフォーム上で動作する上、Vagrantに組み込まれているためです。ただし、このガイドを読み終えた後でも、Vagrantが他の多くのプロバイダ(※)でも動作することをお忘れなく。
(※)リンク先を読んでみた。VMWare Fusion や AWS 等、様々な backend providers で動作する、と書かれているけど、background providers って何?VMWare Fusionって?AWSって?これはまた別の機会に。。

Before diving into your first project, please install Vagrant. And because we'll be using VirtualBox as our provider for the getting started guide, please install that as well.

 初めてのプロジェクトに飛び込む前に、Vagrantをインストールしてください。そして、ガイドではプロバイダとしてVirtualBoxを使用しますので、こちらもインストールをお願いします。

Up and Running

起動・実行

$ vagrant init precise32 http://files.vagrantup.com/precise32.box

$ vagrant up

 After running the above two commands, you'll have a fully running virtual machine in VirtualBox running Ubuntu 12.04 LTS 32-bit. You can SSH into this machine with vagrant ssh, and when you're done playing around, you can remove all traces of it with vagrant destroy.

 上記の2つのコマンドを実行すれば、Ubuntu 12.04 LTS 32-bitのOS上で稼働するVirtualBox仮想マシンが手に入ります。vagrant sshコマンドを叩けばSSHでこの仮想マシンにアクセスできますし、ひとしきり遊び終わったらvagrant destroyコマンドでその証拠を跡形もなく消し去ることができます。

Now imagine every project you've ever worked on being this easy to set up.

少し想像してみてください、あなたがこれまで取り組んできた全てのプロジェクトがこれだけ簡単にセットアップできていたらどれだけ良かったか。

With Vagrant, vagrant up is all you need to work on any project, to install every dependency that project needs, and to setup any networking and synced folders so you can continue working from the comfort of your own machine.

Vagrantでは、必要なのは vagrant up だけです。プロジェクトで作業をするのにも、そのプロジェクトが必要とする全ての従属性を据え付けるのも、自分の端末で作業しているのと同じ快適さが保てるようネットワークや同期済フォルダを設定するためにも。

The rest of this guide will walk you through setting up a more complete project, covering more features of Vagrant.

このガイドの残りの部分では、より完成されたプロジェクトをセットアップする手順と共に、Vagrantの更なる特徴もご紹介します。

メモ

実際にVagrant使った身として申しますが、こんな簡単じゃなかったぜ!
私のような素人には、いきなり$ vagrant init precise32 http://files.vagrantup.com/precise32.boxって言われても、「$」ってどこから出てきたの?!状態ですから。
続き読んだら「Ubuntuかい!」という。。一応、マイPC(WindowsVista)上でUbuntuも動くようにしてあるけどほとんど使ってないからなあ。
とりあえず、このガイドだけじゃ使えるようになりませんぜ、というのが感想だけど、続きの章を読んだら少しずつ分かっていくのかな……