Skip to content

Commit db7c7ec

Browse files
committed
docs: minor editorial improvements, typo fixes
Signed-off-by: David Karlsson <35727626+dvdksn@users.noreply.github.com>
1 parent 103840e commit db7c7ec

36 files changed

+599
-623
lines changed

docs/reference/commandline/attach.md

Lines changed: 38 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -22,13 +22,14 @@ Attach local standard input, output, and error streams to a running container
2222

2323
Use `docker attach` to attach your terminal's standard input, output, and error
2424
(or any combination of the three) to a running container using the container's
25-
ID or name. This allows you to view its ongoing output or to control it
26-
interactively, as though the commands were running directly in your terminal.
25+
ID or name. This lets you view its output or control it interactively, as
26+
though the commands were running directly in your terminal.
2727

28-
> **Note:**
29-
> The `attach` command will display the output of the `ENTRYPOINT/CMD` process. This
30-
> can appear as if the attach command is hung when in fact the process may simply
31-
> not be interacting with the terminal at that time.
28+
> **Note**
29+
>
30+
> The `attach` command displays the output of the container's `ENTRYPOINT` and
31+
> `CMD` process. This can appear as if the attach command is hung when in fact
32+
> the process may simply not be writing any output at that time.
3233
3334
You can attach to the same contained process multiple times simultaneously,
3435
from different sessions on the Docker host.
@@ -38,44 +39,41 @@ container. If `--sig-proxy` is true (the default),`CTRL-c` sends a `SIGINT` to
3839
the container. If the container was run with `-i` and `-t`, you can detach from
3940
a container and leave it running using the `CTRL-p CTRL-q` key sequence.
4041

41-
> **Note:**
42+
> **Note**
43+
>
4244
> A process running as PID 1 inside a container is treated specially by
4345
> Linux: it ignores any signal with the default action. So, the process
44-
> will not terminate on `SIGINT` or `SIGTERM` unless it is coded to do
45-
> so.
46+
> doesn't terminate on `SIGINT` or `SIGTERM` unless it's coded to do so.
4647
47-
It is forbidden to redirect the standard input of a `docker attach` command
48-
while attaching to a TTY-enabled container (using the `-i` and `-t` options).
48+
You can't redirect the standard input of a `docker attach` command while
49+
attaching to a TTY-enabled container (using the `-i` and `-t` options).
4950

50-
While a client is connected to container's `stdio` using `docker attach`, Docker
51-
uses a ~1MB memory buffer to maximize the throughput of the application.
51+
While a client is connected to container's `stdio` using `docker attach`,
52+
Docker uses a ~1MB memory buffer to maximize the throughput of the application.
5253
Once this buffer is full, the speed of the API connection is affected, and so
5354
this impacts the output process' writing speed. This is similar to other
54-
applications like SSH. Because of this, it is not recommended to run
55-
performance critical applications that generate a lot of output in the
56-
foreground over a slow client connection. Instead, users should use the
57-
`docker logs` command to get access to the logs.
55+
applications like SSH. Because of this, it isn't recommended to run
56+
performance-critical applications that generate a lot of output in the
57+
foreground over a slow client connection. Instead, use the `docker logs`
58+
command to get access to the logs.
5859

5960
## Examples
6061

6162
### Attach to and detach from a running container
6263

63-
The following example starts an ubuntu container running `top` in detached mode,
64+
The following example starts an Alpine container running `top` in detached mode,
6465
then attaches to the container;
6566

6667
```console
67-
$ docker run -d --name topdemo ubuntu:22.04 /usr/bin/top -b
68+
$ docker run -d --name topdemo alpine top -b
6869

6970
$ docker attach topdemo
7071

71-
top - 12:27:44 up 3 days, 21:54, 0 users, load average: 0.00, 0.00, 0.00
72-
Tasks: 1 total, 1 running, 0 sleeping, 0 stopped, 0 zombie
73-
%Cpu(s): 0.1 us, 0.1 sy, 0.0 ni, 99.8 id, 0.0 wa, 0.0 hi, 0.0 si, 0.0 st
74-
MiB Mem : 3934.3 total, 770.1 free, 674.2 used, 2490.1 buff/cache
75-
MiB Swap: 1024.0 total, 839.3 free, 184.7 used. 2814.0 avail Mem
76-
77-
PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND
78-
1 root 20 0 7180 2896 2568 R 0.0 0.1 0:00.02 top
72+
Mem: 2395856K used, 5638884K free, 2328K shrd, 61904K buff, 1524264K cached
73+
CPU: 0% usr 0% sys 0% nic 99% idle 0% io 0% irq 0% sirq
74+
Load average: 0.15 0.06 0.01 1/567 6
75+
PID PPID USER STAT VSZ %VSZ CPU %CPU COMMAND
76+
1 0 root R 1700 0% 3 0% top -b
7977
```
8078

8179
As the container was started without the `-i`, and `-t` options, signals are
@@ -85,14 +83,15 @@ container:
8583

8684
```console
8785
<...>
88-
PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND
89-
1 root 20 0 7180 2896 2568 R 0.0 0.1 0:00.02 top^P^Q
86+
PID PPID USER STAT VSZ %VSZ CPU %CPU COMMAND
87+
1 0 root R 1700 0% 7 0% top -b
88+
^P^Q
9089
^C
9190

9291
$ docker ps -a --filter name=topdemo
9392

94-
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
95-
4cf0d0ebb079 ubuntu:22.04 "/usr/bin/top -b" About a minute ago Exited (0) About a minute ago topdemo
93+
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
94+
96254a235bd6 alpine "top -b" 44 seconds ago Exited (130) 8 seconds ago topdemo
9695
```
9796

9897
Repeating the example above, but this time with the `-i` and `-t` options set;
@@ -109,19 +108,17 @@ with `docker ps` shows that the container is still running in the background:
109108
```console
110109
$ docker attach topdemo2
111110

112-
top - 12:44:32 up 3 days, 22:11, 0 users, load average: 0.00, 0.00, 0.00
113-
Tasks: 1 total, 1 running, 0 sleeping, 0 stopped, 0 zombie
114-
%Cpu(s): 50.0 us, 0.0 sy, 0.0 ni, 50.0 id, 0.0 wa, 0.0 hi, 0.0 si, 0.0 st
115-
MiB Mem : 3934.3 total, 770.6 free, 672.4 used, 2491.4 buff/cache
116-
MiB Swap: 1024.0 total, 839.3 free, 184.7 used. 2815.8 avail Mem
117-
118-
PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND
119-
1 root 20 0 7180 2776 2452 R 0.0 0.1 0:00.02 topread escape sequence
111+
Mem: 2405344K used, 5629396K free, 2512K shrd, 65100K buff, 1524952K cached
112+
CPU: 0% usr 0% sys 0% nic 99% idle 0% io 0% irq 0% sirq
113+
Load average: 0.12 0.12 0.05 1/594 6
114+
PID PPID USER STAT VSZ %VSZ CPU %CPU COMMAND
115+
1 0 root R 1700 0% 3 0% top -b
116+
read escape sequence
120117

121118
$ docker ps -a --filter name=topdemo2
122119

123-
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
124-
b1661dce0fc2 ubuntu:22.04 "/usr/bin/top -b" 2 minutes ago Up 2 minutes topdemo2
120+
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
121+
fde88b83c2c2 alpine "top -b" 22 seconds ago Up 21 seconds topdemo2
125122
```
126123

127124
### Get the exit code of the container's command

docs/reference/commandline/build.md

Lines changed: 30 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -60,11 +60,11 @@ pre-packaged tarball contexts and plain text files.
6060

6161
When the `URL` parameter points to the location of a Git repository, the
6262
repository acts as the build context. The system recursively fetches the
63-
repository and its submodules. The commit history is not preserved. A
63+
repository and its submodules. The commit history isn't preserved. A
6464
repository is first pulled into a temporary directory on your local host. After
6565
that succeeds, the directory is sent to the Docker daemon as the context.
6666
Local copy gives you the ability to access private repositories using local
67-
user credentials, VPN's, and so forth.
67+
user credentials, VPNs, and so forth.
6868

6969
> **Note**
7070
>
@@ -100,18 +100,18 @@ contexts:
100100

101101
### Tarball contexts
102102

103-
If you pass an URL to a remote tarball, the URL itself is sent to the daemon:
103+
If you pass a URL to a remote tarball, the URL itself is sent to the daemon:
104104

105105
```console
106106
$ docker build http://server/context.tar.gz
107107
```
108108

109109
The download operation will be performed on the host the Docker daemon is
110-
running on, which is not necessarily the same host from which the build command
110+
running on, which isn't necessarily the same host from which the build command
111111
is being issued. The Docker daemon will fetch `context.tar.gz` and use it as the
112112
build context. Tarball contexts must be tar archives conforming to the standard
113-
`tar` UNIX format and can be compressed with any one of the 'xz', 'bzip2',
114-
'gzip' or 'identity' (no compression) formats.
113+
`tar` Unix format and can be compressed with any one of the `xz`, `bzip2`,
114+
`gzip` or `identity` (no compression) formats.
115115

116116
### Text files
117117

@@ -122,7 +122,7 @@ Instead of specifying a context, you can pass a single `Dockerfile` in the
122122
$ docker build - < Dockerfile
123123
```
124124

125-
With Powershell on Windows, you can run:
125+
With PowerShell on Windows, you can run:
126126

127127
```powershell
128128
Get-Content Dockerfile | docker build -
@@ -136,8 +136,7 @@ By default the `docker build` command will look for a `Dockerfile` at the root
136136
of the build context. The `-f`, `--file`, option lets you specify the path to
137137
an alternative file to use instead. This is useful in cases where the same set
138138
of files are used for multiple builds. The path must be to a file within the
139-
build context. If a relative path is specified then it is interpreted as
140-
relative to the root of the context.
139+
build context. Relative path are interpreted as relative to the root of the context.
141140

142141
In most cases, it's best to put each Dockerfile in an empty directory. Then,
143142
add to that directory only the files needed for building the Dockerfile. To
@@ -152,8 +151,7 @@ running at the time the build is cancelled, the pull is cancelled as well.
152151

153152
## Return code
154153

155-
On a successful build, a return code of success `0` will be returned. When the
156-
build fails, a non-zero failure code will be returned.
154+
Successful builds return exit code `0`. Failed builds return a non-zero exit code.
157155

158156
There should be informational output of the reason for failure output to
159157
`STDERR`:
@@ -214,15 +212,15 @@ local directory get `tar`d and sent to the Docker daemon. The `PATH` specifies
214212
where to find the files for the "context" of the build on the Docker daemon.
215213
Remember that the daemon could be running on a remote machine and that no
216214
parsing of the Dockerfile happens at the client side (where you're running
217-
`docker build`). That means that *all* the files at `PATH` get sent, not just
218-
the ones listed to [*ADD*](https://docs.docker.com/engine/reference/builder/#add)
215+
`docker build`). That means that all the files at `PATH` get sent, not just
216+
the ones listed to [`ADD`](https://docs.docker.com/engine/reference/builder/#add)
219217
in the Dockerfile.
220218

221219
The transfer of context from the local machine to the Docker daemon is what the
222220
`docker` client means when you see the "Sending build context" message.
223221

224222
If you wish to keep the intermediate containers after the build is complete,
225-
you must use `--rm=false`. This does not affect the build cache.
223+
you must use `--rm=false`. This doesn't affect the build cache.
226224

227225
### Build with URL
228226

@@ -252,7 +250,7 @@ Successfully built 377c409b35e4
252250

253251
This sends the URL `http://server/ctx.tar.gz` to the Docker daemon, which
254252
downloads and extracts the referenced tarball. The `-f ctx/Dockerfile`
255-
parameter specifies a path inside `ctx.tar.gz` to the `Dockerfile` that is used
253+
parameter specifies a path inside `ctx.tar.gz` to the `Dockerfile` used
256254
to build the image. Any `ADD` commands in that `Dockerfile` that refers to local
257255
paths must be relative to the root of the contents inside `ctx.tar.gz`. In the
258256
example above, the tarball contains a directory `ctx/`, so the `ADD
@@ -274,7 +272,7 @@ $ docker build - < context.tar.gz
274272
```
275273

276274
This will build an image for a compressed context read from `STDIN`. Supported
277-
formats are: bzip2, gzip and xz.
275+
formats are: `bzip2`, `gzip` and `xz`.
278276

279277
### Use a .dockerignore file
280278

@@ -314,7 +312,6 @@ found, the `.dockerignore` file is used if present. Using a Dockerfile based
314312
`.dockerignore` is useful if a project contains multiple Dockerfiles that expect
315313
to ignore different sets of files.
316314

317-
318315
### <a name="tag"></a> Tag an image (-t, --tag)
319316

320317
```console
@@ -375,12 +372,12 @@ the command line.
375372
> **Note**
376373
>
377374
> `docker build` returns a `no such file or directory` error if the
378-
> file or directory does not exist in the uploaded context. This may
379-
> happen if there is no context, or if you specify a file that is
375+
> file or directory doesn't exist in the uploaded context. This may
376+
> happen if there is no context, or if you specify a file that's
380377
> elsewhere on the Host system. The context is limited to the current
381378
> directory (and its children) for security reasons, and to ensure
382379
> repeatable builds on remote Docker hosts. This is also the reason why
383-
> `ADD ../file` does not work.
380+
> `ADD ../file` doesn't work.
384381
385382
### <a name="cgroup-parent"></a> Use a custom parent cgroup (--cgroup-parent)
386383

@@ -396,7 +393,7 @@ container to be started using those [`--ulimit` flag values](run.md#ulimit).
396393

397394
You can use `ENV` instructions in a Dockerfile to define variable
398395
values. These values persist in the built image. However, often
399-
persistence is not what you want. Users want to specify variables differently
396+
persistence isn't what you want. Users want to specify variables differently
400397
depending on which host they build an image on.
401398

402399
A good example is `http_proxy` or source versions for pulling intermediate
@@ -410,7 +407,7 @@ $ docker build --build-arg HTTP_PROXY=http://10.20.30.2:1234 --build-arg FTP_PRO
410407
This flag allows you to pass the build-time variables that are
411408
accessed like regular environment variables in the `RUN` instruction of the
412409
Dockerfile. Also, these values don't persist in the intermediate or final images
413-
like `ENV` values do. You must add `--build-arg` for each build argument.
410+
like `ENV` values do. You must add `--build-arg` for each build argument.
414411

415412
Using this flag will not alter the output you see when the `ARG` lines from the
416413
Dockerfile are echoed during the build process.
@@ -638,15 +635,14 @@ $ docker build --cache-from myname/myapp .
638635
#### Overview
639636

640637
Once the image is built, squash the new layers into a new image with a single
641-
new layer. Squashing does not destroy any existing image, rather it creates a new
638+
new layer. Squashing doesn't destroy any existing image, rather it creates a new
642639
image with the content of the squashed layers. This effectively makes it look
643640
like all `Dockerfile` commands were created with a single layer. The build
644641
cache is preserved with this method.
645642

646-
The `--squash` option is an experimental feature, and should not be considered
643+
The `--squash` option is an experimental feature, and shouldn't be considered
647644
stable.
648645

649-
650646
Squashing layers can be beneficial if your Dockerfile produces multiple layers
651647
modifying the same files, for example, files that are created in one step, and
652648
removed in another step. For other use-cases, squashing images may actually have
@@ -656,24 +652,23 @@ images (saving space).
656652

657653
For most use cases, multi-stage builds are a better alternative, as they give more
658654
fine-grained control over your build, and can take advantage of future
659-
optimizations in the builder. Refer to the [use multi-stage builds](https://docs.docker.com/develop/develop-images/multistage-build/)
660-
section in the userguide for more information.
661-
655+
optimizations in the builder. Refer to the [Multi-stage builds](https://docs.docker.com/build/building/multi-stage/)
656+
section for more information.
662657

663658
#### Known limitations
664659

665660
The `--squash` option has a number of known limitations:
666661

667-
- When squashing layers, the resulting image cannot take advantage of layer
662+
- When squashing layers, the resulting image can't take advantage of layer
668663
sharing with other images, and may use significantly more space. Sharing the
669664
base image is still supported.
670665
- When using this option you may see significantly more space used due to
671666
storing two copies of the image, one for the build cache with all the cache
672667
layers intact, and one for the squashed version.
673668
- While squashing layers may produce smaller images, it may have a negative
674669
impact on performance, as a single layer takes longer to extract, and
675-
downloading a single layer cannot be parallelized.
676-
- When attempting to squash an image that does not make changes to the
670+
downloading a single layer can't be parallelized.
671+
- When attempting to squash an image that doesn't make changes to the
677672
filesystem (for example, the Dockerfile only contains `ENV` instructions),
678673
the squash step will fail (see [issue #33823](https://github.com/moby/moby/issues/33823)).
679674

@@ -686,7 +681,7 @@ the Docker daemon or setting `experimental: true` in the `daemon.json` configura
686681
file.
687682

688683
By default, experimental mode is disabled. To see the current configuration of
689-
the docker daemon, use the `docker version` command and check the `Experimental`
684+
the Docker daemon, use the `docker version` command and check the `Experimental`
690685
line in the `Engine` section:
691686

692687
```console
@@ -711,10 +706,10 @@ Server: Docker Engine - Community
711706
[...]
712707
```
713708

714-
To enable experimental mode, users need to restart the docker daemon with the
709+
To enable experimental mode, users need to restart the Docker daemon with the
715710
experimental flag enabled.
716711

717-
#### Enable Docker experimental
712+
#### Enable experimental features
718713

719714
To enable experimental features, you need to start the Docker daemon with
720715
`--experimental` flag. You can also enable the daemon flag via
@@ -735,7 +730,7 @@ true
735730

736731
#### Build an image with `--squash` argument
737732

738-
The following is an example of docker build with `--squash` argument
733+
The following is an example of a build with `--squash` argument
739734

740735
```dockerfile
741736
FROM busybox

docs/reference/commandline/checkpoint.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ Manage checkpoints
1818
## Description
1919

2020
Checkpoint and Restore is an experimental feature that allows you to freeze a running
21-
container by checkpointing it, which turns its state into a collection of files
21+
container by specifying a checkpoint, which turns the container state into a collection of files
2222
on disk. Later, the container can be restored from the point it was frozen.
2323

2424
This is accomplished using a tool called [CRIU](https://criu.org), which is an
@@ -29,7 +29,7 @@ checkpoint and restore in Docker is available in this
2929
### Installing CRIU
3030

3131
If you use a Debian system, you can add the CRIU PPA and install with `apt-get`
32-
[from the criu launchpad](https://launchpad.net/~criu/+archive/ubuntu/ppa).
32+
[from the CRIU launchpad](https://launchpad.net/~criu/+archive/ubuntu/ppa).
3333

3434
Alternatively, you can [build CRIU from source](https://criu.org/Installation).
3535

@@ -91,17 +91,17 @@ abc0123
9191
```
9292

9393
This process just logs an incrementing counter to stdout. If you run `docker logs`
94-
in between running/checkpoint/restoring you should see that the counter
95-
increases while the process is running, stops while it's checkpointed, and
94+
in-between running/checkpoint/restoring, you should see that the counter
95+
increases while the process is running, stops while it's frozen, and
9696
resumes from the point it left off once you restore.
9797

9898
### Known limitations
9999

100-
seccomp is only supported by CRIU in very up to date kernels.
100+
`seccomp` is only supported by CRIU in very up-to-date kernels.
101101

102-
External terminal (i.e. `docker run -t ..`) is not supported at the moment.
102+
External terminals (i.e. `docker run -t ..`) aren't supported.
103103
If you try to create a checkpoint for a container with an external terminal,
104-
it would fail:
104+
it fails:
105105

106106
```console
107107
$ docker checkpoint create cr checkpoint1

0 commit comments

Comments
 (0)