| ... | ... |
@@ -2,3 +2,9 @@ |
| 2 | 2 |
.. note:: |
| 3 | 3 |
|
| 4 | 4 |
This example assumes you have Docker running in daemon mode. For more information please see :ref:`running_examples` |
| 5 |
+ |
|
| 6 |
+.. note:: |
|
| 7 |
+ |
|
| 8 |
+ These examples use ``sudo`` before each ``docker`` command you could also |
|
| 9 |
+ add your current ``<username>`` to docker's group and get rid of ``sudo``. |
|
| 10 |
+ You just need to type: ``$ sudo usermod -a -G docker <username>`` |
| ... | ... |
@@ -127,10 +127,11 @@ Check the logs make sure it is working correctly. |
| 127 | 127 |
|
| 128 | 128 |
sudo docker attach $CONTAINER_ID |
| 129 | 129 |
|
| 130 |
-Attach to the container to see the results in realtime. |
|
| 130 |
+Attach to the container to see the results in real-time. |
|
| 131 | 131 |
|
| 132 | 132 |
- **"docker attach**" This will allow us to attach to a background |
| 133 | 133 |
process to see what is going on. |
| 134 |
+- **"-sig-proxy=true" Proxify all received signal to the process (even in non-tty mode) |
|
| 134 | 135 |
- **$CONTAINER_ID** The Id of the container we want to attach too. |
| 135 | 136 |
|
| 136 | 137 |
Exit from the container attachment by pressing Control-C. |
| ... | ... |
@@ -39,11 +39,12 @@ container. The ``BUILD_JOB`` environment variable will be set with the new conta |
| 39 | 39 |
|
| 40 | 40 |
.. code-block:: bash |
| 41 | 41 |
|
| 42 |
- sudo docker attach $BUILD_JOB |
|
| 42 |
+ sudo docker attach -sig-proxy=false $BUILD_JOB |
|
| 43 | 43 |
[...] |
| 44 | 44 |
|
| 45 | 45 |
While this container is running, we can attach to the new container to |
| 46 |
-see what is going on. You can use Ctrl-C to disconnect. |
|
| 46 |
+see what is going on. The flag ``-sig-proxy`` set as ``false`` allows you to connect and |
|
| 47 |
+disconnect (Ctrl-C) to it without stopping the container. |
|
| 47 | 48 |
|
| 48 | 49 |
.. code-block:: bash |
| 49 | 50 |
|
| ... | ... |
@@ -68,6 +68,13 @@ the daemon starts. The ``docker`` daemon must always run as root, but |
| 68 | 68 |
if you run the ``docker`` client as a user in the *docker* group then |
| 69 | 69 |
you don't need to add ``sudo`` to all the client commands. |
| 70 | 70 |
|
| 71 |
+Alternative to ``sudo``? |
|
| 72 |
+------------- |
|
| 73 |
+ |
|
| 74 |
+You can add your current ``<username>`` to docker's group and get rid of |
|
| 75 |
+``sudo`` before each ``docker`` command. You just need to type: |
|
| 76 |
+``$ sudo usermod -a -G docker <username>`` |
|
| 77 |
+ |
|
| 71 | 78 |
.. code-block:: bash |
| 72 | 79 |
|
| 73 | 80 |
# Add the docker group |