From 8ecde8f9a5dcad23afea013a62d373cef303fa84 Mon Sep 17 00:00:00 2001 From: Thatcher Peskens Date: Fri, 19 Apr 2013 20:57:50 -0700 Subject: [PATCH] Updated documentation and fixed Vagrantfile --- Vagrantfile | 51 +++++++++++++----- docs/sources/installation/binaries.rst | 56 ++++++++++++++++++++ docs/sources/installation/index.rst | 2 +- docs/sources/installation/vagrant.rst | 73 ++++++++++++++++++++++++++ docs/sources/installation/windows.rst | 4 +- docs/sources/nginx.conf | 2 + 6 files changed, 172 insertions(+), 16 deletions(-) create mode 100644 docs/sources/installation/binaries.rst create mode 100644 docs/sources/installation/vagrant.rst diff --git a/Vagrantfile b/Vagrantfile index 48b3ef567a..f49e781563 100644 --- a/Vagrantfile +++ b/Vagrantfile @@ -2,19 +2,13 @@ # vi: set ft=ruby : 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 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_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.secret_access_key = ENV["AWS_SECRET_ACCESS_KEY"] aws.keypair_name = ENV["AWS_KEYPAIR_NAME"] aws.ssh_private_key_path = ENV["AWS_SSH_PRIVKEY"] aws.region = "us-east-1" - aws.ami = "ami-ae9806c7" + aws.ami = "ami-d0f89fb9" aws.ssh_username = "ubuntu" aws.instance_type = "t1.micro" 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" 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 diff --git a/docs/sources/installation/binaries.rst b/docs/sources/installation/binaries.rst new file mode 100644 index 0000000000..bf83a5bc88 --- /dev/null +++ b/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. \ No newline at end of file diff --git a/docs/sources/installation/index.rst b/docs/sources/installation/index.rst index b02e9c83ac..ae11258875 100644 --- a/docs/sources/installation/index.rst +++ b/docs/sources/installation/index.rst @@ -13,7 +13,7 @@ Contents: :maxdepth: 1 ubuntulinux - macos + vagrant windows amazon upgrading diff --git a/docs/sources/installation/vagrant.rst b/docs/sources/installation/vagrant.rst new file mode 100644 index 0000000000..5b57721425 --- /dev/null +++ b/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. diff --git a/docs/sources/installation/windows.rst b/docs/sources/installation/windows.rst index 6091d6bac1..a89d3a9014 100644 --- a/docs/sources/installation/windows.rst +++ b/docs/sources/installation/windows.rst @@ -3,8 +3,8 @@ :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 may be out of date because it depends on some binaries to be updated and published diff --git a/docs/sources/nginx.conf b/docs/sources/nginx.conf index cbc954318c..97ffd2c0e5 100644 --- a/docs/sources/nginx.conf +++ b/docs/sources/nginx.conf @@ -2,3 +2,5 @@ # rule to redirect original links created when hosted on github pages 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;