зеркало из https://github.com/microsoft/docker.git
Merge branch 'master' of ssh://github.com/dotcloud/docker
This commit is contained in:
Коммит
3de51b7bfe
1
AUTHORS
1
AUTHORS
|
@ -21,6 +21,7 @@ Jonathan Rudenberg <jonathan@titanous.com>
|
||||||
Julien Barbier <write0@gmail.com>
|
Julien Barbier <write0@gmail.com>
|
||||||
Jérôme Petazzoni <jerome.petazzoni@dotcloud.com>
|
Jérôme Petazzoni <jerome.petazzoni@dotcloud.com>
|
||||||
Ken Cochrane <kencochrane@gmail.com>
|
Ken Cochrane <kencochrane@gmail.com>
|
||||||
|
Kevin J. Lynagh <kevin@keminglabs.com>
|
||||||
Louis Opter <kalessin@kalessin.fr>
|
Louis Opter <kalessin@kalessin.fr>
|
||||||
Mikhail Sobolev <mss@mawhrin.net>
|
Mikhail Sobolev <mss@mawhrin.net>
|
||||||
Nelson Chen <crazysim@gmail.com>
|
Nelson Chen <crazysim@gmail.com>
|
||||||
|
|
|
@ -80,7 +80,7 @@ func ParseRun(args []string, stdout io.Writer) (*Config, error) {
|
||||||
flMemory := cmd.Int64("m", 0, "Memory limit (in bytes)")
|
flMemory := cmd.Int64("m", 0, "Memory limit (in bytes)")
|
||||||
|
|
||||||
var flPorts ports
|
var flPorts ports
|
||||||
cmd.Var(&flPorts, "p", "Map a network port to the container")
|
cmd.Var(&flPorts, "p", "Expose a container's port to the host (use 'docker port' to see the actual mapping)")
|
||||||
|
|
||||||
var flEnv ListOpts
|
var flEnv ListOpts
|
||||||
cmd.Var(&flEnv, "e", "Set environment variables")
|
cmd.Var(&flEnv, "e", "Set environment variables")
|
||||||
|
|
|
@ -10,312 +10,44 @@ Command Line Interface
|
||||||
Docker Usage
|
Docker Usage
|
||||||
~~~~~~~~~~~~
|
~~~~~~~~~~~~
|
||||||
|
|
||||||
::
|
To list available commands, either run ``docker`` with no parameters or execute
|
||||||
|
``docker help``::
|
||||||
|
|
||||||
$ docker
|
$ docker
|
||||||
Usage: docker COMMAND [arg...]
|
Usage: docker COMMAND [arg...]
|
||||||
|
|
||||||
A self-sufficient runtime for linux containers.
|
A self-sufficient runtime for linux containers.
|
||||||
|
|
||||||
Commands:
|
...
|
||||||
attach Attach to a running container
|
|
||||||
commit Create a new image from a container's changes
|
Available Commands
|
||||||
diff Inspect changes on a container's filesystem
|
~~~~~~~~~~~~~~~~~~
|
||||||
export Stream the contents of a container as a tar archive
|
|
||||||
history Show the history of an image
|
.. toctree::
|
||||||
images List images
|
:maxdepth: 1
|
||||||
import Create a new filesystem image from the contents of a tarball
|
|
||||||
info Display system-wide information
|
command/attach
|
||||||
inspect Return low-level information on a container
|
command/commit
|
||||||
kill Kill a running container
|
command/diff
|
||||||
login Register or Login to the docker registry server
|
command/export
|
||||||
logs Fetch the logs of a container
|
command/history
|
||||||
port Lookup the public-facing port which is NAT-ed to PRIVATE_PORT
|
command/images
|
||||||
ps List containers
|
command/import
|
||||||
pull Pull an image or a repository to the docker registry server
|
command/info
|
||||||
push Push an image or a repository to the docker registry server
|
command/inspect
|
||||||
restart Restart a running container
|
command/kill
|
||||||
rm Remove a container
|
command/login
|
||||||
rmi Remove an image
|
command/logs
|
||||||
run Run a command in a new container
|
command/port
|
||||||
start Start a stopped container
|
command/ps
|
||||||
stop Stop a running container
|
command/pull
|
||||||
tag Tag an image into a repository
|
command/push
|
||||||
version Show the docker version information
|
command/restart
|
||||||
wait Block until a container stops, then print its exit code
|
command/rm
|
||||||
|
command/rmi
|
||||||
|
command/run
|
||||||
attach
|
command/start
|
||||||
~~~~~~
|
command/stop
|
||||||
|
command/tag
|
||||||
::
|
command/version
|
||||||
|
command/wait
|
||||||
Usage: docker attach [OPTIONS]
|
|
||||||
|
|
||||||
Attach to a running container
|
|
||||||
|
|
||||||
-e=true: Attach to stderr
|
|
||||||
-i=false: Attach to stdin
|
|
||||||
-o=true: Attach to stdout
|
|
||||||
|
|
||||||
|
|
||||||
commit
|
|
||||||
~~~~~~
|
|
||||||
|
|
||||||
::
|
|
||||||
|
|
||||||
Usage: docker commit [OPTIONS] CONTAINER [DEST]
|
|
||||||
|
|
||||||
Create a new image from a container's changes
|
|
||||||
|
|
||||||
-m="": Commit message
|
|
||||||
|
|
||||||
|
|
||||||
diff
|
|
||||||
~~~~
|
|
||||||
|
|
||||||
::
|
|
||||||
|
|
||||||
Usage: docker diff CONTAINER [OPTIONS]
|
|
||||||
|
|
||||||
Inspect changes on a container's filesystem
|
|
||||||
|
|
||||||
|
|
||||||
export
|
|
||||||
~~~~~~
|
|
||||||
|
|
||||||
::
|
|
||||||
|
|
||||||
Usage: docker export CONTAINER
|
|
||||||
|
|
||||||
Export the contents of a filesystem as a tar archive
|
|
||||||
|
|
||||||
|
|
||||||
history
|
|
||||||
~~~~~~~
|
|
||||||
|
|
||||||
::
|
|
||||||
|
|
||||||
Usage: docker history [OPTIONS] IMAGE
|
|
||||||
|
|
||||||
Show the history of an image
|
|
||||||
|
|
||||||
|
|
||||||
images
|
|
||||||
~~~~~~
|
|
||||||
|
|
||||||
::
|
|
||||||
|
|
||||||
Usage: docker images [OPTIONS] [NAME]
|
|
||||||
|
|
||||||
List images
|
|
||||||
|
|
||||||
-a=false: show all images
|
|
||||||
-q=false: only show numeric IDs
|
|
||||||
|
|
||||||
|
|
||||||
import
|
|
||||||
~~~~~~
|
|
||||||
|
|
||||||
::
|
|
||||||
|
|
||||||
Usage: docker import [OPTIONS] URL|- [REPOSITORY [TAG]]
|
|
||||||
|
|
||||||
Create a new filesystem image from the contents of a tarball
|
|
||||||
|
|
||||||
|
|
||||||
info
|
|
||||||
~~~~
|
|
||||||
|
|
||||||
::
|
|
||||||
|
|
||||||
Usage: docker info
|
|
||||||
|
|
||||||
Display system-wide information.
|
|
||||||
|
|
||||||
|
|
||||||
inspect
|
|
||||||
~~~~~~~
|
|
||||||
|
|
||||||
::
|
|
||||||
|
|
||||||
Usage: docker inspect [OPTIONS] CONTAINER
|
|
||||||
|
|
||||||
Return low-level information on a container
|
|
||||||
|
|
||||||
|
|
||||||
kill
|
|
||||||
~~~~
|
|
||||||
|
|
||||||
::
|
|
||||||
|
|
||||||
Usage: docker kill [OPTIONS] CONTAINER [CONTAINER...]
|
|
||||||
|
|
||||||
Kill a running container
|
|
||||||
|
|
||||||
|
|
||||||
login
|
|
||||||
~~~~~
|
|
||||||
|
|
||||||
::
|
|
||||||
|
|
||||||
Usage: docker login
|
|
||||||
|
|
||||||
Register or Login to the docker registry server
|
|
||||||
|
|
||||||
|
|
||||||
logs
|
|
||||||
~~~~
|
|
||||||
|
|
||||||
::
|
|
||||||
|
|
||||||
Usage: docker logs [OPTIONS] CONTAINER
|
|
||||||
|
|
||||||
Fetch the logs of a container
|
|
||||||
|
|
||||||
|
|
||||||
port
|
|
||||||
~~~~
|
|
||||||
|
|
||||||
::
|
|
||||||
|
|
||||||
Usage: docker port [OPTIONS] CONTAINER PRIVATE_PORT
|
|
||||||
|
|
||||||
Lookup the public-facing port which is NAT-ed to PRIVATE_PORT
|
|
||||||
|
|
||||||
|
|
||||||
ps
|
|
||||||
~~
|
|
||||||
|
|
||||||
::
|
|
||||||
|
|
||||||
Usage: docker ps [OPTIONS]
|
|
||||||
|
|
||||||
List containers
|
|
||||||
|
|
||||||
-a=false: Show all containers. Only running containers are shown by default.
|
|
||||||
-notrunc=false: Don't truncate output
|
|
||||||
-q=false: Only display numeric IDs
|
|
||||||
|
|
||||||
|
|
||||||
pull
|
|
||||||
~~~~
|
|
||||||
|
|
||||||
::
|
|
||||||
|
|
||||||
Usage: docker pull NAME
|
|
||||||
|
|
||||||
Pull an image or a repository from the registry
|
|
||||||
|
|
||||||
push
|
|
||||||
~~~~
|
|
||||||
|
|
||||||
::
|
|
||||||
|
|
||||||
Usage: docker push NAME
|
|
||||||
|
|
||||||
Push an image or a repository to the registry
|
|
||||||
|
|
||||||
|
|
||||||
restart
|
|
||||||
~~~~~~~
|
|
||||||
|
|
||||||
::
|
|
||||||
|
|
||||||
Usage: docker restart [OPTIONS] NAME
|
|
||||||
|
|
||||||
Restart a running container
|
|
||||||
|
|
||||||
|
|
||||||
rm
|
|
||||||
~~
|
|
||||||
|
|
||||||
::
|
|
||||||
|
|
||||||
Usage: docker rm [OPTIONS] CONTAINER
|
|
||||||
|
|
||||||
Remove a container
|
|
||||||
|
|
||||||
|
|
||||||
rmi
|
|
||||||
~~~
|
|
||||||
|
|
||||||
::
|
|
||||||
|
|
||||||
Usage: docker rmi [OPTIONS] IMAGE
|
|
||||||
|
|
||||||
Remove an image
|
|
||||||
|
|
||||||
-a=false: Use IMAGE as a path and remove ALL images in this path
|
|
||||||
-r=false: Use IMAGE as a regular expression instead of an exact name
|
|
||||||
|
|
||||||
|
|
||||||
run
|
|
||||||
~~~
|
|
||||||
|
|
||||||
::
|
|
||||||
|
|
||||||
Usage: docker run [OPTIONS] IMAGE COMMAND [ARG...]
|
|
||||||
|
|
||||||
Run a command in a new container
|
|
||||||
|
|
||||||
-c="": Comment
|
|
||||||
-i=false: Keep stdin open even if not attached
|
|
||||||
-m=0: Memory limit (in bytes)
|
|
||||||
-p=[]: Map a network port to the container
|
|
||||||
-t=false: Allocate a pseudo-tty
|
|
||||||
-h="": Container host name
|
|
||||||
-u="": Username or UID
|
|
||||||
|
|
||||||
|
|
||||||
start
|
|
||||||
~~~~~
|
|
||||||
|
|
||||||
::
|
|
||||||
|
|
||||||
Usage: docker start [OPTIONS] NAME
|
|
||||||
|
|
||||||
Start a stopped container
|
|
||||||
|
|
||||||
|
|
||||||
stop
|
|
||||||
~~~~
|
|
||||||
|
|
||||||
::
|
|
||||||
|
|
||||||
Usage: docker stop [OPTIONS] NAME
|
|
||||||
|
|
||||||
Stop a running container
|
|
||||||
|
|
||||||
|
|
||||||
tag
|
|
||||||
~~~
|
|
||||||
|
|
||||||
::
|
|
||||||
|
|
||||||
Usage: docker tag [OPTIONS] IMAGE REPOSITORY [TAG]
|
|
||||||
|
|
||||||
Tag an image into a repository
|
|
||||||
|
|
||||||
-f=false: Force
|
|
||||||
|
|
||||||
|
|
||||||
version
|
|
||||||
~~~~~~~
|
|
||||||
|
|
||||||
::
|
|
||||||
|
|
||||||
Usage: docker version
|
|
||||||
|
|
||||||
Show the docker version information
|
|
||||||
|
|
||||||
|
|
||||||
wait
|
|
||||||
~~~~
|
|
||||||
|
|
||||||
::
|
|
||||||
|
|
||||||
Usage: docker wait [OPTIONS] NAME
|
|
||||||
|
|
||||||
Block until a container stops, then print its exit code.
|
|
||||||
|
|
||||||
|
|
|
@ -0,0 +1,9 @@
|
||||||
|
===========================================
|
||||||
|
``attach`` -- Attach to a running container
|
||||||
|
===========================================
|
||||||
|
|
||||||
|
::
|
||||||
|
|
||||||
|
Usage: docker attach CONTAINER
|
||||||
|
|
||||||
|
Attach to a running container
|
|
@ -0,0 +1,11 @@
|
||||||
|
===========================================================
|
||||||
|
``commit`` -- Create a new image from a container's changes
|
||||||
|
===========================================================
|
||||||
|
|
||||||
|
::
|
||||||
|
|
||||||
|
Usage: docker commit [OPTIONS] CONTAINER [REPOSITORY [TAG]]
|
||||||
|
|
||||||
|
Create a new image from a container's changes
|
||||||
|
|
||||||
|
-m="": Commit message
|
|
@ -0,0 +1,9 @@
|
||||||
|
=======================================================
|
||||||
|
``diff`` -- Inspect changes on a container's filesystem
|
||||||
|
=======================================================
|
||||||
|
|
||||||
|
::
|
||||||
|
|
||||||
|
Usage: docker diff CONTAINER [OPTIONS]
|
||||||
|
|
||||||
|
Inspect changes on a container's filesystem
|
|
@ -0,0 +1,9 @@
|
||||||
|
=================================================================
|
||||||
|
``export`` -- Stream the contents of a container as a tar archive
|
||||||
|
=================================================================
|
||||||
|
|
||||||
|
::
|
||||||
|
|
||||||
|
Usage: docker export CONTAINER
|
||||||
|
|
||||||
|
Export the contents of a filesystem as a tar archive
|
|
@ -0,0 +1,9 @@
|
||||||
|
===========================================
|
||||||
|
``history`` -- Show the history of an image
|
||||||
|
===========================================
|
||||||
|
|
||||||
|
::
|
||||||
|
|
||||||
|
Usage: docker history [OPTIONS] IMAGE
|
||||||
|
|
||||||
|
Show the history of an image
|
|
@ -0,0 +1,12 @@
|
||||||
|
=========================
|
||||||
|
``images`` -- List images
|
||||||
|
=========================
|
||||||
|
|
||||||
|
::
|
||||||
|
|
||||||
|
Usage: docker images [OPTIONS] [NAME]
|
||||||
|
|
||||||
|
List images
|
||||||
|
|
||||||
|
-a=false: show all images
|
||||||
|
-q=false: only show numeric IDs
|
|
@ -0,0 +1,9 @@
|
||||||
|
==========================================================================
|
||||||
|
``import`` -- Create a new filesystem image from the contents of a tarball
|
||||||
|
==========================================================================
|
||||||
|
|
||||||
|
::
|
||||||
|
|
||||||
|
Usage: docker import [OPTIONS] URL|- [REPOSITORY [TAG]]
|
||||||
|
|
||||||
|
Create a new filesystem image from the contents of a tarball
|
|
@ -0,0 +1,9 @@
|
||||||
|
===========================================
|
||||||
|
``info`` -- Display system-wide information
|
||||||
|
===========================================
|
||||||
|
|
||||||
|
::
|
||||||
|
|
||||||
|
Usage: docker info
|
||||||
|
|
||||||
|
Display system-wide information.
|
|
@ -0,0 +1,9 @@
|
||||||
|
==========================================================
|
||||||
|
``inspect`` -- Return low-level information on a container
|
||||||
|
==========================================================
|
||||||
|
|
||||||
|
::
|
||||||
|
|
||||||
|
Usage: docker inspect [OPTIONS] CONTAINER
|
||||||
|
|
||||||
|
Return low-level information on a container
|
|
@ -0,0 +1,9 @@
|
||||||
|
====================================
|
||||||
|
``kill`` -- Kill a running container
|
||||||
|
====================================
|
||||||
|
|
||||||
|
::
|
||||||
|
|
||||||
|
Usage: docker kill [OPTIONS] CONTAINER [CONTAINER...]
|
||||||
|
|
||||||
|
Kill a running container
|
|
@ -0,0 +1,9 @@
|
||||||
|
============================================================
|
||||||
|
``login`` -- Register or Login to the docker registry server
|
||||||
|
============================================================
|
||||||
|
|
||||||
|
::
|
||||||
|
|
||||||
|
Usage: docker login
|
||||||
|
|
||||||
|
Register or Login to the docker registry server
|
|
@ -0,0 +1,9 @@
|
||||||
|
=========================================
|
||||||
|
``logs`` -- Fetch the logs of a container
|
||||||
|
=========================================
|
||||||
|
|
||||||
|
::
|
||||||
|
|
||||||
|
Usage: docker logs [OPTIONS] CONTAINER
|
||||||
|
|
||||||
|
Fetch the logs of a container
|
|
@ -0,0 +1,9 @@
|
||||||
|
=========================================================================
|
||||||
|
``port`` -- Lookup the public-facing port which is NAT-ed to PRIVATE_PORT
|
||||||
|
=========================================================================
|
||||||
|
|
||||||
|
::
|
||||||
|
|
||||||
|
Usage: docker port [OPTIONS] CONTAINER PRIVATE_PORT
|
||||||
|
|
||||||
|
Lookup the public-facing port which is NAT-ed to PRIVATE_PORT
|
|
@ -0,0 +1,13 @@
|
||||||
|
=========================
|
||||||
|
``ps`` -- List containers
|
||||||
|
=========================
|
||||||
|
|
||||||
|
::
|
||||||
|
|
||||||
|
Usage: docker ps [OPTIONS]
|
||||||
|
|
||||||
|
List containers
|
||||||
|
|
||||||
|
-a=false: Show all containers. Only running containers are shown by default.
|
||||||
|
-notrunc=false: Don't truncate output
|
||||||
|
-q=false: Only display numeric IDs
|
|
@ -0,0 +1,9 @@
|
||||||
|
=========================================================================
|
||||||
|
``pull`` -- Pull an image or a repository from the docker registry server
|
||||||
|
=========================================================================
|
||||||
|
|
||||||
|
::
|
||||||
|
|
||||||
|
Usage: docker pull NAME
|
||||||
|
|
||||||
|
Pull an image or a repository from the registry
|
|
@ -0,0 +1,9 @@
|
||||||
|
=======================================================================
|
||||||
|
``push`` -- Push an image or a repository to the docker registry server
|
||||||
|
=======================================================================
|
||||||
|
|
||||||
|
::
|
||||||
|
|
||||||
|
Usage: docker push NAME
|
||||||
|
|
||||||
|
Push an image or a repository to the registry
|
|
@ -0,0 +1,9 @@
|
||||||
|
==========================================
|
||||||
|
``restart`` -- Restart a running container
|
||||||
|
==========================================
|
||||||
|
|
||||||
|
::
|
||||||
|
|
||||||
|
Usage: docker restart [OPTIONS] NAME
|
||||||
|
|
||||||
|
Restart a running container
|
|
@ -0,0 +1,9 @@
|
||||||
|
============================
|
||||||
|
``rm`` -- Remove a container
|
||||||
|
============================
|
||||||
|
|
||||||
|
::
|
||||||
|
|
||||||
|
Usage: docker rm [OPTIONS] CONTAINER
|
||||||
|
|
||||||
|
Remove a container
|
|
@ -0,0 +1,9 @@
|
||||||
|
==========================
|
||||||
|
``rmi`` -- Remove an image
|
||||||
|
==========================
|
||||||
|
|
||||||
|
::
|
||||||
|
|
||||||
|
Usage: docker rmimage [OPTIONS] IMAGE
|
||||||
|
|
||||||
|
Remove an image
|
|
@ -0,0 +1,19 @@
|
||||||
|
===========================================
|
||||||
|
``run`` -- Run a command in a new container
|
||||||
|
===========================================
|
||||||
|
|
||||||
|
::
|
||||||
|
|
||||||
|
Usage: docker run [OPTIONS] IMAGE COMMAND [ARG...]
|
||||||
|
|
||||||
|
Run a command in a new container
|
||||||
|
|
||||||
|
-a=map[]: Attach to stdin, stdout or stderr.
|
||||||
|
-d=false: Detached mode: leave the container running in the background
|
||||||
|
-e=[]: Set environment variables
|
||||||
|
-h="": Container host name
|
||||||
|
-i=false: Keep stdin open even if not attached
|
||||||
|
-m=0: Memory limit (in bytes)
|
||||||
|
-p=[]: Map a network port to the container
|
||||||
|
-t=false: Allocate a pseudo-tty
|
||||||
|
-u="": Username or UID
|
|
@ -0,0 +1,9 @@
|
||||||
|
======================================
|
||||||
|
``start`` -- Start a stopped container
|
||||||
|
======================================
|
||||||
|
|
||||||
|
::
|
||||||
|
|
||||||
|
Usage: docker start [OPTIONS] NAME
|
||||||
|
|
||||||
|
Start a stopped container
|
|
@ -0,0 +1,9 @@
|
||||||
|
====================================
|
||||||
|
``stop`` -- Stop a running container
|
||||||
|
====================================
|
||||||
|
|
||||||
|
::
|
||||||
|
|
||||||
|
Usage: docker stop [OPTIONS] NAME
|
||||||
|
|
||||||
|
Stop a running container
|
|
@ -0,0 +1,11 @@
|
||||||
|
=========================================
|
||||||
|
``tag`` -- Tag an image into a repository
|
||||||
|
=========================================
|
||||||
|
|
||||||
|
::
|
||||||
|
|
||||||
|
Usage: docker tag [OPTIONS] IMAGE REPOSITORY [TAG]
|
||||||
|
|
||||||
|
Tag an image into a repository
|
||||||
|
|
||||||
|
-f=false: Force
|
|
@ -0,0 +1,3 @@
|
||||||
|
==================================================
|
||||||
|
``version`` -- Show the docker version information
|
||||||
|
==================================================
|
|
@ -0,0 +1,9 @@
|
||||||
|
===================================================================
|
||||||
|
``wait`` -- Block until a container stops, then print its exit code
|
||||||
|
===================================================================
|
||||||
|
|
||||||
|
::
|
||||||
|
|
||||||
|
Usage: docker wait [OPTIONS] NAME
|
||||||
|
|
||||||
|
Block until a container stops, then print its exit code.
|
|
@ -15,4 +15,4 @@ Contents:
|
||||||
hello_world
|
hello_world
|
||||||
hello_world_daemon
|
hello_world_daemon
|
||||||
python_web_app
|
python_web_app
|
||||||
runningsshservice
|
running_ssh_service
|
||||||
|
|
|
@ -65,6 +65,4 @@ See the example in action
|
||||||
<iframe width="720" height="350" src="http://ascii.io/a/2573/raw" frameborder="0"></iframe>
|
<iframe width="720" height="350" src="http://ascii.io/a/2573/raw" frameborder="0"></iframe>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
Continue to the `base commands`_
|
Continue to :ref:`running_ssh_service`.
|
||||||
|
|
||||||
.. _base commands: ../commandline/basecommands.html
|
|
||||||
|
|
|
@ -1,3 +1,8 @@
|
||||||
|
:title: Running an SSH service
|
||||||
|
:description: A screencast of installing and running an sshd service
|
||||||
|
:keywords: docker, example, package installation, networking
|
||||||
|
|
||||||
|
.. _running_ssh_service:
|
||||||
|
|
||||||
Create an ssh daemon service
|
Create an ssh daemon service
|
||||||
============================
|
============================
|
Загрузка…
Ссылка в новой задаче