- Fix the attach examples according to the new attach behavior

- Add the option of adding the user to docker's group and avoid the usage of "sudo" before each command
This commit is contained in:
Roberto Gandolfo Hashioka 2013-11-07 14:06:49 -08:00
parent b5c984f9b4
commit 304d39cc50
4 changed files with 14 additions and 4 deletions

View File

@ -127,10 +127,11 @@ 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.

View File

@ -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

View File

@ -21,7 +21,8 @@ smooth, but gives you a good idea.
daemon is unprotected and available via a TCP port. When you run
through the same steps in a newer version of Docker, you will
need to add ``sudo`` in front of each ``docker`` command in order
to reach the daemon over its protected Unix socket.
to reach the daemon over its protected Unix socket or you can add
your user to docker's group: ``sudo usermod -a -G docker <user>``.
.. raw:: html

View File

@ -54,6 +54,13 @@ 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.
Alternative to ``sudo``?
-------------
You can add your current ``<username>`` to docker's group and get rid of
``sudo`` before each ``docker`` command. You just need to type:
``$ sudo usermod -a -G docker <username>``
.. code-block:: bash
# Add the docker group