mirror of https://github.com/docker/docs.git
fix attach and remove cli doc
This commit is contained in:
parent
842cb8909e
commit
4576e11121
|
@ -949,7 +949,7 @@ func CmdAttach(args ...string) error {
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
body, _, err := call("GET", "/containers/"+cmd.Arg(0), nil)
|
body, _, err := call("GET", "/containers/"+cmd.Arg(0)+"/json", nil)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
@ -961,7 +961,6 @@ func CmdAttach(args ...string) error {
|
||||||
}
|
}
|
||||||
|
|
||||||
v := url.Values{}
|
v := url.Values{}
|
||||||
v.Set("logs", "1")
|
|
||||||
v.Set("stream", "1")
|
v.Set("stream", "1")
|
||||||
v.Set("stdout", "1")
|
v.Set("stdout", "1")
|
||||||
v.Set("stderr", "1")
|
v.Set("stderr", "1")
|
||||||
|
|
|
@ -1,55 +0,0 @@
|
||||||
:title: Command Line Interface
|
|
||||||
:description: Docker's CLI command description and usage
|
|
||||||
:keywords: Docker, Docker documentation, CLI, command line
|
|
||||||
|
|
||||||
.. _cli:
|
|
||||||
|
|
||||||
Command Line Interface
|
|
||||||
======================
|
|
||||||
|
|
||||||
Docker Usage
|
|
||||||
~~~~~~~~~~~~
|
|
||||||
|
|
||||||
To list available commands, either run ``docker`` with no parameters or execute
|
|
||||||
``docker help``::
|
|
||||||
|
|
||||||
$ docker
|
|
||||||
Usage: docker COMMAND [arg...]
|
|
||||||
|
|
||||||
A self-sufficient runtime for linux containers.
|
|
||||||
|
|
||||||
...
|
|
||||||
|
|
||||||
Available Commands
|
|
||||||
~~~~~~~~~~~~~~~~~~
|
|
||||||
|
|
||||||
.. toctree::
|
|
||||||
:maxdepth: 1
|
|
||||||
|
|
||||||
command/attach
|
|
||||||
command/build
|
|
||||||
command/commit
|
|
||||||
command/diff
|
|
||||||
command/export
|
|
||||||
command/history
|
|
||||||
command/images
|
|
||||||
command/import
|
|
||||||
command/info
|
|
||||||
command/inspect
|
|
||||||
command/kill
|
|
||||||
command/login
|
|
||||||
command/logs
|
|
||||||
command/port
|
|
||||||
command/ps
|
|
||||||
command/pull
|
|
||||||
command/push
|
|
||||||
command/restart
|
|
||||||
command/rm
|
|
||||||
command/rmi
|
|
||||||
command/run
|
|
||||||
command/search
|
|
||||||
command/start
|
|
||||||
command/stop
|
|
||||||
command/tag
|
|
||||||
command/version
|
|
||||||
command/wait
|
|
|
@ -1,9 +0,0 @@
|
||||||
===========================================
|
|
||||||
``attach`` -- Attach to a running container
|
|
||||||
===========================================
|
|
||||||
|
|
||||||
::
|
|
||||||
|
|
||||||
Usage: docker attach CONTAINER
|
|
||||||
|
|
||||||
Attach to a running container
|
|
|
@ -1,9 +0,0 @@
|
||||||
===========================================
|
|
||||||
``build`` -- Build a container from Dockerfile via stdin
|
|
||||||
===========================================
|
|
||||||
|
|
||||||
::
|
|
||||||
|
|
||||||
Usage: docker build -
|
|
||||||
Example: cat Dockerfile | docker build -
|
|
||||||
Build a new image from the Dockerfile passed via stdin
|
|
|
@ -1,27 +0,0 @@
|
||||||
===========================================================
|
|
||||||
``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
|
|
||||||
-author="": Author (eg. "John Hannibal Smith <hannibal@a-team.com>"
|
|
||||||
-run="": Config automatically applied when the image is run. "+`(ex: {"Cmd": ["cat", "/world"], "PortSpecs": ["22"]}')
|
|
||||||
|
|
||||||
Full -run example::
|
|
||||||
|
|
||||||
{"Hostname": "",
|
|
||||||
"User": "",
|
|
||||||
"Memory": 0,
|
|
||||||
"MemorySwap": 0,
|
|
||||||
"PortSpecs": ["22", "80", "443"],
|
|
||||||
"Tty": true,
|
|
||||||
"OpenStdin": true,
|
|
||||||
"StdinOnce": true,
|
|
||||||
"Env": ["FOO=BAR", "FOO2=BAR2"],
|
|
||||||
"Cmd": ["cat", "-e", "/etc/resolv.conf"],
|
|
||||||
"Dns": ["8.8.8.8", "8.8.4.4"]}
|
|
|
@ -1,9 +0,0 @@
|
||||||
=======================================================
|
|
||||||
``diff`` -- Inspect changes on a container's filesystem
|
|
||||||
=======================================================
|
|
||||||
|
|
||||||
::
|
|
||||||
|
|
||||||
Usage: docker diff CONTAINER [OPTIONS]
|
|
||||||
|
|
||||||
Inspect changes on a container's filesystem
|
|
|
@ -1,9 +0,0 @@
|
||||||
=================================================================
|
|
||||||
``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
|
|
|
@ -1,9 +0,0 @@
|
||||||
===========================================
|
|
||||||
``history`` -- Show the history of an image
|
|
||||||
===========================================
|
|
||||||
|
|
||||||
::
|
|
||||||
|
|
||||||
Usage: docker history [OPTIONS] IMAGE
|
|
||||||
|
|
||||||
Show the history of an image
|
|
|
@ -1,22 +0,0 @@
|
||||||
=========================
|
|
||||||
``images`` -- List images
|
|
||||||
=========================
|
|
||||||
|
|
||||||
::
|
|
||||||
|
|
||||||
Usage: docker images [OPTIONS] [NAME]
|
|
||||||
|
|
||||||
List images
|
|
||||||
|
|
||||||
-a=false: show all images
|
|
||||||
-q=false: only show numeric IDs
|
|
||||||
-viz=false: output in graphviz format
|
|
||||||
|
|
||||||
Displaying images visually
|
|
||||||
--------------------------
|
|
||||||
|
|
||||||
::
|
|
||||||
|
|
||||||
docker images -viz | dot -Tpng -o docker.png
|
|
||||||
|
|
||||||
.. image:: images/docker_images.gif
|
|
Binary file not shown.
Before Width: | Height: | Size: 35 KiB |
|
@ -1,9 +0,0 @@
|
||||||
==========================================================================
|
|
||||||
``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
|
|
|
@ -1,9 +0,0 @@
|
||||||
===========================================
|
|
||||||
``info`` -- Display system-wide information
|
|
||||||
===========================================
|
|
||||||
|
|
||||||
::
|
|
||||||
|
|
||||||
Usage: docker info
|
|
||||||
|
|
||||||
Display system-wide information.
|
|
|
@ -1,9 +0,0 @@
|
||||||
==========================================================
|
|
||||||
``inspect`` -- Return low-level information on a container
|
|
||||||
==========================================================
|
|
||||||
|
|
||||||
::
|
|
||||||
|
|
||||||
Usage: docker inspect [OPTIONS] CONTAINER
|
|
||||||
|
|
||||||
Return low-level information on a container
|
|
|
@ -1,9 +0,0 @@
|
||||||
====================================
|
|
||||||
``kill`` -- Kill a running container
|
|
||||||
====================================
|
|
||||||
|
|
||||||
::
|
|
||||||
|
|
||||||
Usage: docker kill [OPTIONS] CONTAINER [CONTAINER...]
|
|
||||||
|
|
||||||
Kill a running container
|
|
|
@ -1,9 +0,0 @@
|
||||||
============================================================
|
|
||||||
``login`` -- Register or Login to the docker registry server
|
|
||||||
============================================================
|
|
||||||
|
|
||||||
::
|
|
||||||
|
|
||||||
Usage: docker login
|
|
||||||
|
|
||||||
Register or Login to the docker registry server
|
|
|
@ -1,9 +0,0 @@
|
||||||
=========================================
|
|
||||||
``logs`` -- Fetch the logs of a container
|
|
||||||
=========================================
|
|
||||||
|
|
||||||
::
|
|
||||||
|
|
||||||
Usage: docker logs [OPTIONS] CONTAINER
|
|
||||||
|
|
||||||
Fetch the logs of a container
|
|
|
@ -1,9 +0,0 @@
|
||||||
=========================================================================
|
|
||||||
``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
|
|
|
@ -1,13 +0,0 @@
|
||||||
=========================
|
|
||||||
``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
|
|
|
@ -1,9 +0,0 @@
|
||||||
=========================================================================
|
|
||||||
``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
|
|
|
@ -1,9 +0,0 @@
|
||||||
=======================================================================
|
|
||||||
``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
|
|
|
@ -1,9 +0,0 @@
|
||||||
==========================================
|
|
||||||
``restart`` -- Restart a running container
|
|
||||||
==========================================
|
|
||||||
|
|
||||||
::
|
|
||||||
|
|
||||||
Usage: docker restart [OPTIONS] NAME
|
|
||||||
|
|
||||||
Restart a running container
|
|
|
@ -1,9 +0,0 @@
|
||||||
============================
|
|
||||||
``rm`` -- Remove a container
|
|
||||||
============================
|
|
||||||
|
|
||||||
::
|
|
||||||
|
|
||||||
Usage: docker rm [OPTIONS] CONTAINER
|
|
||||||
|
|
||||||
Remove a container
|
|
|
@ -1,9 +0,0 @@
|
||||||
==========================
|
|
||||||
``rmi`` -- Remove an image
|
|
||||||
==========================
|
|
||||||
|
|
||||||
::
|
|
||||||
|
|
||||||
Usage: docker rmimage [OPTIONS] IMAGE
|
|
||||||
|
|
||||||
Remove an image
|
|
|
@ -1,22 +0,0 @@
|
||||||
===========================================
|
|
||||||
``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
|
|
||||||
-d=[]: Set custom dns servers for the container
|
|
||||||
-v=[]: Creates a new volumes and mount it at the specified path.
|
|
||||||
-volumes-from="": Mount all volumes from the given container.
|
|
|
@ -1,10 +0,0 @@
|
||||||
===================================================================
|
|
||||||
``search`` -- Search for an image in the docker index
|
|
||||||
===================================================================
|
|
||||||
|
|
||||||
::
|
|
||||||
|
|
||||||
Usage: docker search TERM
|
|
||||||
|
|
||||||
Searches for the TERM parameter on the Docker index and prints out a list of repositories
|
|
||||||
that match.
|
|
|
@ -1,9 +0,0 @@
|
||||||
======================================
|
|
||||||
``start`` -- Start a stopped container
|
|
||||||
======================================
|
|
||||||
|
|
||||||
::
|
|
||||||
|
|
||||||
Usage: docker start [OPTIONS] NAME
|
|
||||||
|
|
||||||
Start a stopped container
|
|
|
@ -1,9 +0,0 @@
|
||||||
====================================
|
|
||||||
``stop`` -- Stop a running container
|
|
||||||
====================================
|
|
||||||
|
|
||||||
::
|
|
||||||
|
|
||||||
Usage: docker stop [OPTIONS] NAME
|
|
||||||
|
|
||||||
Stop a running container
|
|
|
@ -1,11 +0,0 @@
|
||||||
=========================================
|
|
||||||
``tag`` -- Tag an image into a repository
|
|
||||||
=========================================
|
|
||||||
|
|
||||||
::
|
|
||||||
|
|
||||||
Usage: docker tag [OPTIONS] IMAGE REPOSITORY [TAG]
|
|
||||||
|
|
||||||
Tag an image into a repository
|
|
||||||
|
|
||||||
-f=false: Force
|
|
|
@ -1,3 +0,0 @@
|
||||||
==================================================
|
|
||||||
``version`` -- Show the docker version information
|
|
||||||
==================================================
|
|
|
@ -1,9 +0,0 @@
|
||||||
===================================================================
|
|
||||||
``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.
|
|
|
@ -9,8 +9,7 @@ Commands
|
||||||
Contents:
|
Contents:
|
||||||
|
|
||||||
.. toctree::
|
.. toctree::
|
||||||
:maxdepth: 3
|
:maxdepth: 2
|
||||||
|
|
||||||
basics
|
basics
|
||||||
workingwithrepository
|
workingwithrepository
|
||||||
cli
|
|
Loading…
Reference in New Issue