Fix examples in README to no longer rely on standalone mode
This commit is contained in:
parent
deb55e416e
commit
3ae5c45d9a
2 changed files with 25 additions and 21 deletions
25
README.md
25
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")
|
||||
|
||||
|
|
|
@ -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 <command>
|
||||
|
||||
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 <command>
|
||||
# now you can run docker commands from any account.
|
||||
docker help
|
||||
|
|
Loading…
Reference in a new issue