mirror of
https://github.com/docker/cli.git
synced 2026-01-22 03:22:01 +03:00
Improve code/comment/output markings & display consistency
This PR aims to increase the consistency across the docs for
code blocks and code/comment/output markings.
Rule followed here is "what's visible on the screen should be reflected"
Issue:
- Docs had various code blocks showing: comments, commands & outputs.
- All three of these items were inconsistently marked.
Some examples as to how this PR aims to introduce improvements:
1. Removed `> ` from in front of the "outputs". Eg,
` > REPOSITORY TAG ID CREATED` replaced with:
` REPOSITORY TAG ID CREATED`.
2. Introduced `$` for commands. Eg,
` sudo chkconfig docker on` replaced with:
` $ sudo chkconfig docker on`
3. Comments:
` > # ` replaced with:
` # `.
> Please note:
> Due to a vast amount of items reviewed and changed for this PR, there
> might be some individually incorrect replacements OR patterns of incorrect
> replacements. This PR needs to be reviewed and if there is anything missing,
> it should be improved or amended.
Closes:
https://github.com/dotcloud/docker/issues/5286
Docker-DCO-1.1-Signed-off-by: O.S. Tezer <ostezer@gmail.com> (github: ostezer)
Upstream-commit: b8073c74a7
Component: cli
This commit is contained in:
@@ -18,7 +18,7 @@ This file will describe the steps to assemble the image.
|
||||
Then call `docker build` with the path of you source repository as argument
|
||||
(for example, `.`):
|
||||
|
||||
sudo docker build .
|
||||
$ sudo docker build .
|
||||
|
||||
The path to the source repository defines where to find the *context* of
|
||||
the build. The build is run by the Docker daemon, not by the CLI, so the
|
||||
@@ -28,7 +28,7 @@ whole context must be transferred to the daemon. The Docker CLI reports
|
||||
You can specify a repository and tag at which to save the new image if
|
||||
the build succeeds:
|
||||
|
||||
sudo docker build -t shykes/myapp .
|
||||
$ sudo docker build -t shykes/myapp .
|
||||
|
||||
The Docker daemon will run your steps one-by-one, committing the result
|
||||
to a new image if necessary, before finally outputting the ID of your
|
||||
|
||||
@@ -35,11 +35,11 @@ will set the value to the opposite of the default value.
|
||||
|
||||
Options like `-a=[]` indicate they can be specified multiple times:
|
||||
|
||||
docker run -a stdin -a stdout -a stderr -i -t ubuntu /bin/bash
|
||||
$ docker run -a stdin -a stdout -a stderr -i -t ubuntu /bin/bash
|
||||
|
||||
Sometimes this can use a more complex value string, as for `-v`:
|
||||
|
||||
docker run -v /host:/container example/mysql
|
||||
$ docker run -v /host:/container example/mysql
|
||||
|
||||
### Strings and Integers
|
||||
|
||||
@@ -100,10 +100,10 @@ To use lxc as the execution driver, use `docker -d -e lxc`.
|
||||
The docker client will also honor the `DOCKER_HOST` environment variable to set
|
||||
the `-H` flag for the client.
|
||||
|
||||
docker -H tcp://0.0.0.0:4243 ps
|
||||
$ docker -H tcp://0.0.0.0:4243 ps
|
||||
# or
|
||||
export DOCKER_HOST="tcp://0.0.0.0:4243"
|
||||
docker ps
|
||||
$ export DOCKER_HOST="tcp://0.0.0.0:4243"
|
||||
$ docker ps
|
||||
# both are equal
|
||||
|
||||
To run the daemon with [systemd socket activation](
|
||||
@@ -448,7 +448,7 @@ by default.
|
||||
<none> <none> 77af4d6b9913 19 hours ago 1.089 GB
|
||||
committest latest b6fa739cedf5 19 hours ago 1.089 GB
|
||||
<none> <none> 78a85c484f71 19 hours ago 1.089 GB
|
||||
docker latest 30557a29d5ab 20 hours ago 1.089 GB
|
||||
$ docker latest 30557a29d5ab 20 hours ago 1.089 GB
|
||||
<none> <none> 0124422dd9f9 20 hours ago 1.089 GB
|
||||
<none> <none> 18ad6fad3402 22 hours ago 1.082 GB
|
||||
<none> <none> f9f1e26352f0 23 hours ago 1.089 GB
|
||||
@@ -462,7 +462,7 @@ by default.
|
||||
<none> <none> 77af4d6b9913e693e8d0b4b294fa62ade6054e6b2f1ffb617ac955dd63fb0182 19 hours ago 1.089 GB
|
||||
committest latest b6fa739cedf5ea12a620a439402b6004d057da800f91c7524b5086a5e4749c9f 19 hours ago 1.089 GB
|
||||
<none> <none> 78a85c484f71509adeaace20e72e941f6bdd2b25b4c75da8693efd9f61a37921 19 hours ago 1.089 GB
|
||||
docker latest 30557a29d5abc51e5f1d5b472e79b7e296f595abcf19fe6b9199dbbc809c6ff4 20 hours ago 1.089 GB
|
||||
$ docker latest 30557a29d5abc51e5f1d5b472e79b7e296f595abcf19fe6b9199dbbc809c6ff4 20 hours ago 1.089 GB
|
||||
<none> <none> 0124422dd9f9cf7ef15c0617cda3931ee68346455441d66ab8bdc5b05e9fdce5 20 hours ago 1.089 GB
|
||||
<none> <none> 18ad6fad340262ac2a636efd98a6d1f0ea775ae3d45240d3418466495a19a81b 22 hours ago 1.082 GB
|
||||
<none> <none> f9f1e26352f0a3ba6a0ff68167559f64f3e21ff7ada60366e2d44a04befd1d3a 23 hours ago 1.089 GB
|
||||
@@ -640,7 +640,7 @@ If you want to login to a private registry you can
|
||||
specify this by adding the server name.
|
||||
|
||||
example:
|
||||
docker login localhost:8080
|
||||
$ docker login localhost:8080
|
||||
|
||||
## logs
|
||||
|
||||
|
||||
@@ -22,7 +22,7 @@ running containers, and so here we try to give more in-depth guidance.
|
||||
As you`ve seen in the [*Examples*](/examples/#example-list), the
|
||||
basic run command takes this form:
|
||||
|
||||
docker run [OPTIONS] IMAGE[:TAG] [COMMAND] [ARG...]
|
||||
$ docker run [OPTIONS] IMAGE[:TAG] [COMMAND] [ARG...]
|
||||
|
||||
To learn how to interpret the types of `[OPTIONS]`,
|
||||
see [*Option types*](/commandline/cli/#cli-options).
|
||||
@@ -99,7 +99,7 @@ https://github.com/dotcloud/docker/blob/
|
||||
of the three standard streams (`stdin`, `stdout`, `stderr`) you'd like to connect
|
||||
instead, as in:
|
||||
|
||||
docker run -a stdin -a stdout -i -t ubuntu /bin/bash
|
||||
$ docker run -a stdin -a stdout -i -t ubuntu /bin/bash
|
||||
|
||||
For interactive processes (like a shell) you will typically want a tty as well as
|
||||
persistent standard input (`stdin`), so you'll use `-i -t` together in most
|
||||
@@ -233,7 +233,7 @@ Dockerfile instruction and how the operator can override that setting.
|
||||
Recall the optional `COMMAND` in the Docker
|
||||
commandline:
|
||||
|
||||
docker run [OPTIONS] IMAGE[:TAG] [COMMAND] [ARG...]
|
||||
$ docker run [OPTIONS] IMAGE[:TAG] [COMMAND] [ARG...]
|
||||
|
||||
This command is optional because the person who created the `IMAGE` may have
|
||||
already provided a default `COMMAND` using the Dockerfile `CMD`. As the
|
||||
@@ -259,12 +259,12 @@ runtime by using a string to specify the new `ENTRYPOINT`. Here is an
|
||||
example of how to run a shell in a container that has been set up to
|
||||
automatically run something else (like `/usr/bin/redis-server`):
|
||||
|
||||
docker run -i -t --entrypoint /bin/bash example/redis
|
||||
$ docker run -i -t --entrypoint /bin/bash example/redis
|
||||
|
||||
or two examples of how to pass more parameters to that ENTRYPOINT:
|
||||
|
||||
docker run -i -t --entrypoint /bin/bash example/redis -c ls -l
|
||||
docker run -i -t --entrypoint /usr/bin/redis-cli example/redis --help
|
||||
$ docker run -i -t --entrypoint /bin/bash example/redis -c ls -l
|
||||
$ docker run -i -t --entrypoint /usr/bin/redis-cli example/redis --help
|
||||
|
||||
## EXPOSE (Incoming Ports)
|
||||
|
||||
@@ -335,7 +335,7 @@ container running Redis:
|
||||
# The redis-name container exposed port 6379
|
||||
$ docker ps
|
||||
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
|
||||
4241164edf6f dockerfiles/redis:latest /redis-stable/src/re 5 seconds ago Up 4 seconds 6379/tcp redis-name
|
||||
4241164edf6f $ dockerfiles/redis:latest /redis-stable/src/re 5 seconds ago Up 4 seconds 6379/tcp redis-name
|
||||
|
||||
# Note that there are no public ports exposed since we didn᾿t use -p or -P
|
||||
$ docker port 4241164edf6f 6379
|
||||
|
||||
Reference in New Issue
Block a user