mirror of
https://github.com/moby/moby.git
synced 2022-11-09 12:21:53 -05:00
Merge pull request #4210 from cpuguy83/4208-update_docs_to_better_explain_docker_run
Add extra info regarding docker run funcationality
This commit is contained in:
commit
1308673965
2 changed files with 4 additions and 0 deletions
|
@ -917,6 +917,8 @@ Running ``docker ps`` showing 2 linked containers.
|
||||||
|
|
||||||
The last container is marked as a ``Ghost`` container. It is a container that was running when the docker daemon was restarted (upgraded, or ``-H`` settings changed). The container is still running, but as this docker daemon process is not able to manage it, you can't attach to it. To bring them out of ``Ghost`` Status, you need to use ``docker kill`` or ``docker restart``.
|
The last container is marked as a ``Ghost`` container. It is a container that was running when the docker daemon was restarted (upgraded, or ``-H`` settings changed). The container is still running, but as this docker daemon process is not able to manage it, you can't attach to it. To bring them out of ``Ghost`` Status, you need to use ``docker kill`` or ``docker restart``.
|
||||||
|
|
||||||
|
``docker ps`` will show only running containers by default. To see all containers: ``docker ps -a``
|
||||||
|
|
||||||
.. _cli_pull:
|
.. _cli_pull:
|
||||||
|
|
||||||
``pull``
|
``pull``
|
||||||
|
@ -1085,6 +1087,7 @@ The ``docker run`` command first ``creates`` a writeable container layer over
|
||||||
the specified image, and then ``starts`` it using the specified command. That
|
the specified image, and then ``starts`` it using the specified command. That
|
||||||
is, ``docker run`` is equivalent to the API ``/containers/create`` then
|
is, ``docker run`` is equivalent to the API ``/containers/create`` then
|
||||||
``/containers/(id)/start``.
|
``/containers/(id)/start``.
|
||||||
|
Once the container is stopped it still exists and can be started back up. See ``docker ps -a`` to view a list of all containers.
|
||||||
|
|
||||||
The ``docker run`` command can be used in combination with ``docker commit`` to
|
The ``docker run`` command can be used in combination with ``docker commit`` to
|
||||||
:ref:`change the command that a container runs <cli_commit_examples>`.
|
:ref:`change the command that a container runs <cli_commit_examples>`.
|
||||||
|
|
|
@ -50,6 +50,7 @@ Running an interactive shell
|
||||||
# allocate a tty, attach stdin and stdout
|
# allocate a tty, attach stdin and stdout
|
||||||
# To detach the tty without exiting the shell,
|
# To detach the tty without exiting the shell,
|
||||||
# use the escape sequence Ctrl-p + Ctrl-q
|
# use the escape sequence Ctrl-p + Ctrl-q
|
||||||
|
# note: This will continue to exist in a stopped state once exited (see "docker ps -a")
|
||||||
sudo docker run -i -t ubuntu /bin/bash
|
sudo docker run -i -t ubuntu /bin/bash
|
||||||
|
|
||||||
.. _bind_docker:
|
.. _bind_docker:
|
||||||
|
|
Loading…
Reference in a new issue