diff --git a/README.md b/README.md index 4ba9222f85..2c40658429 100644 --- a/README.md +++ b/README.md @@ -122,8 +122,26 @@ Some streamlined (but possibly outdated) installation paths' are available from Usage examples ============== -Running an interactive shell ----------------------------- +First run the docker daemon +--------------------------- + +All the examples assume your machine is running the docker daemon. To run the docker daemon in the background, simply type: + + .. code-block:: bash + + sudo docker -d & + +Now you can run docker in client mode: all commands will be forwarded to the docker daemon, so the client +can run from any account. + + .. code-block:: bash + + # now you can run docker commands from any account. + docker help + + +Throwaway shell in a base ubuntu image +-------------------------------------- ```bash # Download a base image @@ -145,9 +163,6 @@ Starting a long-running worker process -------------------------------------- ```bash -# Run docker in daemon mode -(docker -d || echo "Docker daemon already running") & - # Start a very useful long-running process JOB=$(docker run -d base /bin/sh -c "while true; do echo Hello world; sleep 1; done") diff --git a/docs/sources/examples/running_examples.rst b/docs/sources/examples/running_examples.rst index 4042add487..3d2593c710 100644 --- a/docs/sources/examples/running_examples.rst +++ b/docs/sources/examples/running_examples.rst @@ -7,27 +7,16 @@ Running The Examples -------------------- -There are two ways to run docker, daemon mode and standalone mode. - -When you run the docker command it will first check if there is a docker daemon running in the background it can connect to. - -* If it exists it will use that daemon to run all of the commands. -* If it does not exist docker will run in standalone mode (docker will exit after each command). - -Docker needs to be run from a privileged account (root). - -1. The most common (and recommended) way is to run a docker daemon as root in the background, and then connect to it from the docker client from any account. +All the examples assume your machine is running the docker daemon. To run the docker daemon in the background, simply type: .. code-block:: bash - # starting docker daemon in the background sudo docker -d & - # now you can run docker commands from any account. - docker - -2. Standalone: You need to run every command as root, or using sudo +Now you can run docker in client mode: all commands will be forwarded to the docker daemon, so the client +can run from any account. .. code-block:: bash - sudo docker + # now you can run docker commands from any account. + docker help