diff --git a/docs/Makefile b/docs/Makefile index d7602ae826..f74bf5705e 100644 --- a/docs/Makefile +++ b/docs/Makefile @@ -45,9 +45,9 @@ clean: docs: -rm -rf $(BUILDDIR)/* - $(SPHINXBUILD) -b html $(ALLSPHINXOPTS) $(BUILDDIR)/html + $(SPHINXBUILD) -b dirhtml $(ALLSPHINXOPTS) $(BUILDDIR)/html cp sources/index.html $(BUILDDIR)/html/ - cp sources/gettingstarted.html $(BUILDDIR)/html/ + cp -r sources/gettingstarted $(BUILDDIR)/html/ cp sources/dotcloud.yml $(BUILDDIR)/html/ cp sources/CNAME $(BUILDDIR)/html/ cp sources/.nojekyll $(BUILDDIR)/html/ diff --git a/docs/sources/documentation/commandline/basecommands.rst b/docs/sources/commandline/basecommands.rst similarity index 100% rename from docs/sources/documentation/commandline/basecommands.rst rename to docs/sources/commandline/basecommands.rst diff --git a/docs/sources/documentation/commandline/cli.rst b/docs/sources/commandline/cli.rst similarity index 100% rename from docs/sources/documentation/commandline/cli.rst rename to docs/sources/commandline/cli.rst diff --git a/docs/sources/documentation/commandline/index.rst b/docs/sources/commandline/index.rst similarity index 100% rename from docs/sources/documentation/commandline/index.rst rename to docs/sources/commandline/index.rst diff --git a/docs/sources/documentation/concepts/containers.rst b/docs/sources/concepts/containers.rst similarity index 100% rename from docs/sources/documentation/concepts/containers.rst rename to docs/sources/concepts/containers.rst diff --git a/docs/sources/documentation/concepts/index.rst b/docs/sources/concepts/index.rst similarity index 100% rename from docs/sources/documentation/concepts/index.rst rename to docs/sources/concepts/index.rst diff --git a/docs/sources/documentation/contributing/contributing.rst b/docs/sources/contributing/contributing.rst similarity index 100% rename from docs/sources/documentation/contributing/contributing.rst rename to docs/sources/contributing/contributing.rst diff --git a/docs/sources/documentation/contributing/devenvironment.rst b/docs/sources/contributing/devenvironment.rst similarity index 100% rename from docs/sources/documentation/contributing/devenvironment.rst rename to docs/sources/contributing/devenvironment.rst diff --git a/docs/sources/documentation/contributing/index.rst b/docs/sources/contributing/index.rst similarity index 100% rename from docs/sources/documentation/contributing/index.rst rename to docs/sources/contributing/index.rst diff --git a/docs/sources/documentation/examples/hello_world.rst b/docs/sources/documentation/examples/hello_world.rst deleted file mode 100644 index 910bc1f366..0000000000 --- a/docs/sources/documentation/examples/hello_world.rst +++ /dev/null @@ -1,34 +0,0 @@ -:title: Hello world example -:description: A simple hello world example with Docker -:keywords: docker, example, hello world - -.. _hello_world: - -Hello World -=========== -This is the most basic example available for using docker - -This example assumes you have Docker installed and it will download the busybox image and then use that image to run a simple echo command, that will echo hello world back to the console over standard out. - -.. code-block:: bash - - $ docker run busybox /bin/echo hello world - -**Explanation:** - -- **"docker run"** run a command in a new container -- **"busybox"** is the image we want to run the command inside of. -- **"/bin/echo"** is the command we want to run in the container -- **"hello world"** is the input for the echo command - -**Video:** - -See the example in action - -.. raw:: html - -
- -
- -Continue to the :ref:`hello_world_daemon` example. \ No newline at end of file diff --git a/docs/sources/documentation/index.rst b/docs/sources/documentation/index.rst deleted file mode 100644 index 92efc113e0..0000000000 --- a/docs/sources/documentation/index.rst +++ /dev/null @@ -1,18 +0,0 @@ -:title: docker documentation -:description: docker documentation -:keywords: - -Documentation -============= - -This documentation has the following resources: - -.. toctree:: - :maxdepth: 1 - - concepts/index - installation/index - examples/index - contributing/index - commandline/index - faq \ No newline at end of file diff --git a/docs/sources/documentation/installation/amazon.rst b/docs/sources/documentation/installation/amazon.rst deleted file mode 100644 index 730a77e62c..0000000000 --- a/docs/sources/documentation/installation/amazon.rst +++ /dev/null @@ -1,54 +0,0 @@ -Amazon EC2 -========== - - - -Installation ------------- - -Install vagrant from http://www.vagrantup.com/ (or use your package manager) - -clone the repo - - -Docker can be installed with Vagrant on Amazon EC2, using Vagrant 1.1 is required for EC2, but deploying is as simple as: - -:: - - $ export AWS_ACCESS_KEY_ID=xxx \ - AWS_SECRET_ACCESS_KEY=xxx \ - AWS_KEYPAIR_NAME=xxx \ - AWS_SSH_PRIVKEY=xxx - -:: - - $ vagrant plugin install vagrant-aws - -:: - - $ vagrant up --provider=aws - -The environment variables are: - -* ``AWS_ACCESS_KEY_ID`` - The API key used to make requests to AWS -* ``AWS_SECRET_ACCESS_KEY`` - The secret key to make AWS API requests -* ``AWS_KEYPAIR_NAME`` - The ID of the keypair used for this EC2 instance -* ``AWS_SSH_PRIVKEY`` - The path to the private key for the named keypair - - -Make sure your default security zone on AWS includes rights to SSH to your container. Otherwise access will -fail silently. - - -.. code-block:: bash - - vagrant ssh - -Now you are in the VM, run docker - -.. code-block:: bash - - docker - - -Continue with the :ref:`hello_world` example. \ No newline at end of file diff --git a/docs/sources/examples/hello_world.rst b/docs/sources/examples/hello_world.rst new file mode 100644 index 0000000000..f6387d487e --- /dev/null +++ b/docs/sources/examples/hello_world.rst @@ -0,0 +1,50 @@ +:title: Hello world example +:description: A simple hello world example with Docker +:keywords: docker, example, hello world + +.. _hello_world: + +Hello World +=========== +This is the most basic example available for using docker + +This example assumes you have Docker installed. + + +Download the base container + +.. code-block:: bash + + # Download a base image + docker pull base + +The *base* image is a minimal *ubuntu* based container, alternatively you can select *busybox*, a bare +minimal linux system. The images are retrieved from the docker repository. + + +.. code-block:: bash + + #run a simple echo command, that will echo hello world back to the console over standard out. + docker run base /bin/echo hello world + +**Explanation:** + +- **"docker run"** run a command in a new container +- **"base"** is the image we want to run the command inside of. +- **"/bin/echo"** is the command we want to run in the container +- **"hello world"** is the input for the echo command + + + +**Video:** + +See the example in action + +.. raw:: html + +
+ +
+ + +Continue to the :ref:`hello_world_daemon` example. \ No newline at end of file diff --git a/docs/sources/documentation/examples/hello_world_daemon.rst b/docs/sources/examples/hello_world_daemon.rst similarity index 69% rename from docs/sources/documentation/examples/hello_world_daemon.rst rename to docs/sources/examples/hello_world_daemon.rst index e92a67cde6..6ced505f1d 100644 --- a/docs/sources/documentation/examples/hello_world_daemon.rst +++ b/docs/sources/examples/hello_world_daemon.rst @@ -8,18 +8,20 @@ Hello World Daemon ================== The most boring daemon ever written. -This example assumes you have Docker installed and with the busybox image already imported. We will use the busybox image to run a simple hello world daemon that will just print hello world to standard out every second. It will continue to do this until we stop it. +This example assumes you have Docker installed and with the base image already imported ``docker pull base``. +We will use the base image to run a simple hello world daemon that will just print hello world to standard +out every second. It will continue to do this until we stop it. **Steps:** .. code-block:: bash - $ CONTAINER_ID=$(docker run -d busybox /bin/sh -c "while true; do echo hello world; sleep 1; done") + $ CONTAINER_ID=$(docker run -d base /bin/sh -c "while true; do echo hello world; sleep 1; done") We are going to run a simple hello world daemon in a new container made from the busybox daemon. - **"docker run -d "** run a command in a new container. We pass "-d" so it runs as a daemon. -- **"busybox"** is the image we want to run the command inside of. +- **"base"** is the image we want to run the command inside of. - **"/bin/sh -c"** is the command we want to run in the container - **"while true; do echo hello world; sleep 1; done"** is the mini script we want to run, that will just print hello world once a second until we stop it. - **$CONTAINER_ID** the output of the run command will return a container id, we can use in future commands to see what is going on with this process. @@ -35,7 +37,7 @@ Check the logs make sure it is working correctly. .. code-block:: bash - $ docker attach $CONTAINER_ID + docker attach $CONTAINER_ID Attach to the container to see the results in realtime. @@ -44,7 +46,7 @@ Attach to the container to see the results in realtime. .. code-block:: bash - $ docker ps + docker ps Check the process list to make sure it is running. @@ -61,7 +63,7 @@ Stop the container, since we don't need it anymore. .. code-block:: bash - $ docker ps + docker ps Make sure it is really stopped. @@ -76,4 +78,12 @@ See the example in action -Continue to the :ref:`python_web_app` example. \ No newline at end of file +Continue to the :ref:`python_web_app` example. + + +Notes: +------ + +- **Docker daemon** The docker daemon is started by ``sudo docker -d``, Vagrant may have started + the Docker daemon for you, but you will need to restart it this way if it was terminated. Otherwise + it may give you ``Couldn't create Tag store: open /var/lib/docker/repositories: permission denied`` diff --git a/docs/sources/documentation/examples/index.rst b/docs/sources/examples/index.rst similarity index 100% rename from docs/sources/documentation/examples/index.rst rename to docs/sources/examples/index.rst diff --git a/docs/sources/documentation/examples/python_web_app.rst b/docs/sources/examples/python_web_app.rst similarity index 100% rename from docs/sources/documentation/examples/python_web_app.rst rename to docs/sources/examples/python_web_app.rst diff --git a/docs/sources/documentation/faq.rst b/docs/sources/faq.rst similarity index 100% rename from docs/sources/documentation/faq.rst rename to docs/sources/faq.rst diff --git a/docs/sources/gettingstarted.html b/docs/sources/gettingstarted/index.html similarity index 86% rename from docs/sources/gettingstarted.html rename to docs/sources/gettingstarted/index.html index 7d198629cd..48de374c1e 100644 --- a/docs/sources/gettingstarted.html +++ b/docs/sources/gettingstarted/index.html @@ -13,15 +13,15 @@ - - + + - + - - + + @@ -34,9 +34,9 @@
- +
@@ -99,7 +99,7 @@

Consider adding docker to your PATH for simplicity.

- Continue with the Hello world example. + Continue with the Hello world example. @@ -117,8 +117,8 @@ vagrant and an Ubuntu virtual machine.

@@ -180,7 +180,7 @@ - + - - @@ -36,9 +34,9 @@