123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319 |
- :title: Command Line Interface
- :description: Docker's CLI command description and usage
- :keywords: Docker, Docker documentation, CLI, command line
- Command Line Interface
- ======================
- Docker Usage
- ~~~~~~~~~~~~
- ::
- $ docker
- Usage: docker COMMAND [arg...]
- A self-sufficient runtime for linux containers.
- Commands:
- attach Attach to a running container
- commit Create a new image from a container's changes
- 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
- images List images
- import Create a new filesystem image from the contents of a tarball
- info Display system-wide information
- inspect Return low-level information on a container
- kill Kill a running container
- login Register or Login to the docker registry server
- logs Fetch the logs of a container
- port Lookup the public-facing port which is NAT-ed to PRIVATE_PORT
- ps List containers
- pull Pull an image or a repository to the docker registry server
- push Push an image or a repository to the docker registry server
- restart Restart a running container
- rm Remove a container
- rmi Remove an image
- run Run a command in a new container
- start Start a stopped container
- stop Stop a running container
- tag Tag an image into a repository
- version Show the docker version information
- wait Block until a container stops, then print its exit code
- attach
- ~~~~~~
- ::
- 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
- -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.
|