瀏覽代碼

Updated documentation and fixed Vagrantfile

Thatcher Peskens 12 年之前
父節點
當前提交
8ecde8f9a5

+ 38 - 13
Vagrantfile

@@ -2,19 +2,13 @@
 # vi: set ft=ruby :
 # vi: set ft=ruby :
 
 
 def v10(config)
 def v10(config)
-  config.vm.box = "quantal64_3.5.0-25"
-  config.vm.box_url = "http://get.docker.io/vbox/ubuntu/12.10/quantal64_3.5.0-25.box"
+  config.vm.box = 'precise64'
+  config.vm.box_url = 'http://files.vagrantup.com/precise64.box'
 
 
-  config.vm.share_folder "v-data", "/opt/go/src/github.com/dotcloud/docker", File.dirname(__FILE__)
+  # Install ubuntu packaging dependencies and create ubuntu packages
+  config.vm.provision :shell, :inline => "echo 'deb http://ppa.launchpad.net/dotcloud/lxc-docker/ubuntu precise main' >>/etc/apt/sources.list"
+  config.vm.provision :shell, :inline => 'export DEBIAN_FRONTEND=noninteractive; apt-get -qq update; apt-get install -qq -y --force-yes lxc-docker'
 
 
-  # Ensure puppet is installed on the instance
-  config.vm.provision :shell, :inline => "apt-get -qq update; apt-get install -y puppet"
-
-  config.vm.provision :puppet do |puppet|
-    puppet.manifests_path = "puppet/manifests"
-    puppet.manifest_file  = "quantal64.pp"
-    puppet.module_path = "puppet/modules"
-  end
 end
 end
 
 
 Vagrant::VERSION < "1.1.0" and Vagrant::Config.run do |config|
 Vagrant::VERSION < "1.1.0" and Vagrant::Config.run do |config|
@@ -30,11 +24,11 @@ Vagrant::VERSION >= "1.1.0" and Vagrant.configure("2") do |config|
     config.vm.box = "dummy"
     config.vm.box = "dummy"
     config.vm.box_url = "https://github.com/mitchellh/vagrant-aws/raw/master/dummy.box"
     config.vm.box_url = "https://github.com/mitchellh/vagrant-aws/raw/master/dummy.box"
     aws.access_key_id = ENV["AWS_ACCESS_KEY_ID"]
     aws.access_key_id = ENV["AWS_ACCESS_KEY_ID"]
-    aws.secret_access_key = ENV["AWS_SECRET_ACCESS_KEY"]
+    aws.secret_access_key =     ENV["AWS_SECRET_ACCESS_KEY"]
     aws.keypair_name = ENV["AWS_KEYPAIR_NAME"]
     aws.keypair_name = ENV["AWS_KEYPAIR_NAME"]
     aws.ssh_private_key_path = ENV["AWS_SSH_PRIVKEY"]
     aws.ssh_private_key_path = ENV["AWS_SSH_PRIVKEY"]
     aws.region = "us-east-1"
     aws.region = "us-east-1"
-    aws.ami = "ami-ae9806c7"
+    aws.ami = "ami-d0f89fb9"
     aws.ssh_username = "ubuntu"
     aws.ssh_username = "ubuntu"
     aws.instance_type = "t1.micro"
     aws.instance_type = "t1.micro"
   end
   end
@@ -55,3 +49,34 @@ Vagrant::VERSION >= "1.1.0" and Vagrant.configure("2") do |config|
     config.vm.box_url = "http://get.docker.io/vbox/ubuntu/12.10/quantal64_3.5.0-25.box"
     config.vm.box_url = "http://get.docker.io/vbox/ubuntu/12.10/quantal64_3.5.0-25.box"
   end
   end
 end
 end
+
+Vagrant::VERSION >= "1.2.0" and Vagrant.configure("2") do |config|
+  config.vm.provider :aws do |aws, override|
+    config.vm.box = "dummy"
+    config.vm.box_url = "https://github.com/mitchellh/vagrant-aws/raw/master/dummy.box"
+    aws.access_key_id = ENV["AWS_ACCESS_KEY_ID"]
+    aws.secret_access_key = ENV["AWS_SECRET_ACCESS_KEY"]
+    aws.keypair_name = ENV["AWS_KEYPAIR_NAME"]
+    override.ssh.private_key_path = ENV["AWS_SSH_PRIVKEY"]
+    override.ssh.username = "ubuntu"
+    aws.region = "us-east-1"
+    aws.ami = "ami-d0f89fb9"
+    aws.instance_type = "t1.micro"
+  end
+
+  config.vm.provider :rackspace do |rs|
+    config.vm.box = "dummy"
+    config.vm.box_url = "https://github.com/mitchellh/vagrant-rackspace/raw/master/dummy.box"
+    config.ssh.private_key_path = ENV["RS_PRIVATE_KEY"]
+    rs.username = ENV["RS_USERNAME"]
+    rs.api_key  = ENV["RS_API_KEY"]
+    rs.public_key_path = ENV["RS_PUBLIC_KEY"]
+    rs.flavor   = /512MB/
+    rs.image    = /Ubuntu/
+  end
+
+  config.vm.provider :virtualbox do |vb|
+    config.vm.box = "quantal64_3.5.0-25"
+    config.vm.box_url = "http://get.docker.io/vbox/ubuntu/12.10/quantal64_3.5.0-25.box"
+  end
+end

+ 56 - 0
docs/sources/installation/binaries.rst

@@ -0,0 +1,56 @@
+.. _ubuntu_linux:
+
+Ubuntu Linux
+============
+
+  **Please note this project is currently under heavy development. It should not be used in production.**
+
+
+
+Installing on Ubuntu 12.04 and 12.10
+
+Right now, the officially supported distributions are:
+
+Ubuntu 12.04 (precise LTS)
+Ubuntu 12.10 (quantal)
+Docker probably works on other distributions featuring a recent kernel, the AUFS patch, and up-to-date lxc. However this has not been tested.
+
+Install dependencies:
+---------------------
+
+::
+
+    sudo apt-get install lxc wget bsdtar curl
+    sudo apt-get install linux-image-extra-`uname -r`
+
+The linux-image-extra package is needed on standard Ubuntu EC2 AMIs in order to install the aufs kernel module.
+
+Install the latest docker binary:
+
+::
+
+    wget http://get.docker.io/builds/$(uname -s)/$(uname -m)/docker-master.tgz
+    tar -xf docker-master.tgz
+
+Run your first container!
+
+::
+
+    cd docker-master
+
+::
+
+    sudo ./docker run -i -t base /bin/bash
+
+
+To run docker as a daemon, in the background, and allow non-root users to run ``docker`` start
+docker -d
+
+::
+
+    sudo ./docker -d &
+
+
+Consider adding docker to your PATH for simplicity.
+
+Continue with the :ref:`hello_world` example.

+ 1 - 1
docs/sources/installation/index.rst

@@ -13,7 +13,7 @@ Contents:
    :maxdepth: 1
    :maxdepth: 1
 
 
    ubuntulinux
    ubuntulinux
-   macos
+   vagrant
    windows
    windows
    amazon
    amazon
    upgrading
    upgrading

+ 73 - 0
docs/sources/installation/vagrant.rst

@@ -0,0 +1,73 @@
+
+.. _install_using_vagrant:
+
+Install using Vagrant
+=====================
+
+  Please note this is a community contributed installation path. The only 'official' installation is using the :ref:`ubuntu_linux` installation path. This version
+  may be out of date because it depends on some binaries to be updated and published
+
+**requirements**
+This guide will setup a new virtual machine on your computer. This works on most operating systems,
+including MacOX, Windows, Linux, FreeBSD and others. If you can
+install these and have at least 400Mb RAM to spare you should be good.
+
+
+Install Vagrant, Virtualbox and Git
+-----------------------------------
+
+We currently rely on some Ubuntu-linux specific packages, this will change in the future, but for now we provide a
+streamlined path to install Virtualbox with a Ubuntu 12.10 image using Vagrant.
+
+1. Install virtualbox from https://www.virtualbox.org/ (or use your package manager)
+2. Install vagrant from http://www.vagrantup.com/ (or use your package manager)
+3. Install git if you had not installed it before, check if it is installed by running
+   ``git`` in a terminal window
+
+We recommend having at least about 2Gb of free disk space and 2Gb RAM (or more).
+
+Spin up your machine
+--------------------
+
+1. Fetch the docker sources
+
+.. code-block:: bash
+
+   git clone https://github.com/dotcloud/docker.git
+
+2. Run vagrant from the sources directory
+
+.. code-block:: bash
+
+    vagrant up
+
+Vagrant will:
+
+* Download the Quantal64 base ubuntu virtual machine image from get.docker.io/
+* Boot this image in virtualbox
+
+Then it will use Puppet to perform an initial setup in this machine:
+
+* Download & untar the most recent docker binary tarball to vagrant homedir.
+* Debootstrap to /var/lib/docker/images/ubuntu.
+* Install & run dockerd as service.
+* Put docker in /usr/local/bin.
+* Put latest Go toolchain in /usr/local/go.
+
+You now have a Ubuntu Virtual Machine running with docker pre-installed.
+
+To access the VM and use Docker, Run ``vagrant ssh`` from the same directory as where you ran
+``vagrant up``. Vagrant will make sure to connect you to the correct VM.
+
+.. code-block:: bash
+
+    vagrant ssh
+
+Now you are in the VM, run docker
+
+.. code-block:: bash
+
+    docker
+
+
+Continue with the :ref:`hello_world` example.

+ 2 - 2
docs/sources/installation/windows.rst

@@ -3,8 +3,8 @@
 :keywords: Docker, Docker documentation, Windows, requirements, virtualbox, vagrant, git, ssh, putty, cygwin
 :keywords: Docker, Docker documentation, Windows, requirements, virtualbox, vagrant, git, ssh, putty, cygwin
 
 
 
 
-Windows
-=========
+Windows (with Vagrant)
+======================
 
 
   Please note this is a community contributed installation path. The only 'official' installation is using the :ref:`ubuntu_linux` installation path. This version
   Please note this is a community contributed installation path. The only 'official' installation is using the :ref:`ubuntu_linux` installation path. This version
   may be out of date because it depends on some binaries to be updated and published
   may be out of date because it depends on some binaries to be updated and published

+ 2 - 0
docs/sources/nginx.conf

@@ -2,3 +2,5 @@
 # rule to redirect original links created when hosted on github pages
 # rule to redirect original links created when hosted on github pages
 rewrite ^/documentation/(.*).html http://docs.docker.io/en/latest/$1/ permanent;
 rewrite ^/documentation/(.*).html http://docs.docker.io/en/latest/$1/ permanent;
 
 
+# rewrite the stuff which was on the current page
+rewrite ^/gettingstarted.html$ /gettingstarted/ permanent;