diff --git a/docs/sources/examples/example_header.inc b/docs/sources/examples/example_header.inc index 607421fc13..0621b39794 100644 --- a/docs/sources/examples/example_header.inc +++ b/docs/sources/examples/example_header.inc @@ -1,4 +1,7 @@ .. note:: - This example assumes you have Docker running in daemon mode. For more information please see :ref:`running_examples` + * This example assumes you have Docker running in daemon mode. For + more information please see :ref:`running_examples`. + * **If you don't like sudo** then see :ref:`dockergroup` + diff --git a/docs/sources/examples/hello_world.rst b/docs/sources/examples/hello_world.rst index 6d6c1b28a6..99eaa2c483 100644 --- a/docs/sources/examples/hello_world.rst +++ b/docs/sources/examples/hello_world.rst @@ -127,10 +127,12 @@ Check the logs make sure it is working correctly. sudo docker attach $CONTAINER_ID -Attach to the container to see the results in realtime. +Attach to the container to see the results in real-time. - **"docker attach**" This will allow us to attach to a background process to see what is going on. +- **"-sig-proxy=true"** Proxify all received signal to the process + (even in non-tty mode) - **$CONTAINER_ID** The Id of the container we want to attach too. Exit from the container attachment by pressing Control-C. diff --git a/docs/sources/examples/python_web_app.rst b/docs/sources/examples/python_web_app.rst index e3f5f5eb83..3034bf980a 100644 --- a/docs/sources/examples/python_web_app.rst +++ b/docs/sources/examples/python_web_app.rst @@ -39,11 +39,12 @@ container. The ``BUILD_JOB`` environment variable will be set with the new conta .. code-block:: bash - sudo docker attach $BUILD_JOB + sudo docker attach -sig-proxy=false $BUILD_JOB [...] While this container is running, we can attach to the new container to -see what is going on. You can use Ctrl-C to disconnect. +see what is going on. The flag ``-sig-proxy`` set as ``false`` allows you to connect and +disconnect (Ctrl-C) to it without stopping the container. .. code-block:: bash diff --git a/docs/sources/use/basics.rst b/docs/sources/use/basics.rst index 4cc43a1f29..0b3fafced1 100644 --- a/docs/sources/use/basics.rst +++ b/docs/sources/use/basics.rst @@ -53,32 +53,36 @@ Running an interactive shell .. _dockergroup: -Why ``sudo``? -------------- +sudo and the docker Group +------------------------- The ``docker`` daemon always runs as root, and since ``docker`` version 0.5.2, ``docker`` binds to a Unix socket instead of a TCP port. By default that Unix socket is owned by the user *root*, and so, by default, you can access it with ``sudo``. -Starting in version 0.5.3, if you create a Unix group called *docker* -and add users to it, then the ``docker`` daemon will make the -ownership of the Unix socket read/writable by the *docker* group when -the daemon starts. The ``docker`` daemon must always run as root, but -if you run the ``docker`` client as a user in the *docker* group then -you don't need to add ``sudo`` to all the client commands. +Starting in version 0.5.3, if you (or your Docker installer) create a +Unix group called *docker* and add users to it, then the ``docker`` +daemon will make the ownership of the Unix socket read/writable by the +*docker* group when the daemon starts. The ``docker`` daemon must +always run as root, but if you run the ``docker`` client as a user in +the *docker* group then you don't need to add ``sudo`` to all the +client commands. + +**Example:** .. code-block:: bash - # Add the docker group + # Add the docker group if it doesn't already exist. sudo groupadd docker - # Add the ubuntu user to the docker group + # Add the user "ubuntu" to the docker group. + # Change the user name to match your preferred user. # You may have to logout and log back in again for - # this to take effect + # this to take effect. sudo gpasswd -a ubuntu docker - # Restart the docker daemon + # Restart the docker daemon. sudo service docker restart .. _bind_docker: