mirror of https://github.com/docker/docs.git
Merge pull request #4526 from Rovanion/master
All caps variables in normal bash should be avoided not to accidentally collide with environment variables.
This commit is contained in:
commit
2ad16c88e2
|
@ -92,7 +92,7 @@ we stop it.
|
|||
|
||||
.. code-block:: bash
|
||||
|
||||
CONTAINER_ID=$(sudo docker run -d ubuntu /bin/sh -c "while true; do echo hello world; sleep 1; done")
|
||||
container_id=$(sudo docker run -d ubuntu /bin/sh -c "while true; do echo hello world; sleep 1; done")
|
||||
|
||||
We are going to run a simple hello world daemon in a new container
|
||||
made from the ``ubuntu`` image.
|
||||
|
@ -104,22 +104,22 @@ made from the ``ubuntu`` image.
|
|||
- **"while true; do echo hello world; sleep 1; done"** is the mini
|
||||
script we want to run, that will just print hello world once a
|
||||
second until we stop it.
|
||||
- **$CONTAINER_ID** the output of the run command will return a
|
||||
- **$container_id** the output of the run command will return a
|
||||
container id, we can use in future commands to see what is going on
|
||||
with this process.
|
||||
|
||||
.. code-block:: bash
|
||||
|
||||
sudo docker logs $CONTAINER_ID
|
||||
sudo docker logs $container_id
|
||||
|
||||
Check the logs make sure it is working correctly.
|
||||
|
||||
- **"docker logs**" This will return the logs for a container
|
||||
- **$CONTAINER_ID** The Id of the container we want the logs for.
|
||||
- **$container_id** The Id of the container we want the logs for.
|
||||
|
||||
.. code-block:: bash
|
||||
|
||||
sudo docker attach -sig-proxy=false $CONTAINER_ID
|
||||
sudo docker attach -sig-proxy=false $container_id
|
||||
|
||||
Attach to the container to see the results in real-time.
|
||||
|
||||
|
@ -127,7 +127,7 @@ Attach to the container to see the results in real-time.
|
|||
process to see what is going on.
|
||||
- **"-sig-proxy=false"** Do not forward signals to the container; allows
|
||||
us to exit the attachment using Control-C without stopping the container.
|
||||
- **$CONTAINER_ID** The Id of the container we want to attach too.
|
||||
- **$container_id** The Id of the container we want to attach too.
|
||||
|
||||
Exit from the container attachment by pressing Control-C.
|
||||
|
||||
|
@ -141,12 +141,12 @@ Check the process list to make sure it is running.
|
|||
|
||||
.. code-block:: bash
|
||||
|
||||
sudo docker stop $CONTAINER_ID
|
||||
sudo docker stop $container_id
|
||||
|
||||
Stop the container, since we don't need it anymore.
|
||||
|
||||
- **"docker stop"** This stops a container
|
||||
- **$CONTAINER_ID** The Id of the container we want to stop.
|
||||
- **$container_id** The Id of the container we want to stop.
|
||||
|
||||
.. code-block:: bash
|
||||
|
||||
|
|
Loading…
Reference in New Issue