Skip to content

Commit 40707e1

Browse files
thaJeztahvvoland
authored andcommitted
docs: refresh image versions in examples
use current LTS versions of ubuntu where suitable, remove uses of ubuntu:23.10 (which reache EOL), and and update some other examples to use more current versions. Signed-off-by: Sebastiaan van Stijn <[email protected]> (cherry picked from commit b36522b) Signed-off-by: Paweł Gronowski <[email protected]>
1 parent 9593373 commit 40707e1

File tree

12 files changed

+106
-114
lines changed

12 files changed

+106
-114
lines changed

docs/reference/commandline/container_attach.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ CONTAINER ID IMAGE COMMAND CREATED STATUS
9797
Repeating the example above, but this time with the `-i` and `-t` options set;
9898

9999
```console
100-
$ docker run -dit --name topdemo2 ubuntu:22.04 /usr/bin/top -b
100+
$ docker run -dit --name topdemo2 alpine /usr/bin/top -b
101101
```
102102

103103
Now, when attaching to the container, and pressing the `CTRL-p CTRL-q` ("read

docs/reference/commandline/container_commit.md

+8-8
Original file line numberDiff line numberDiff line change
@@ -44,8 +44,8 @@ created. Supported `Dockerfile` instructions:
4444
$ docker ps
4545

4646
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
47-
c3f279d17e0a ubuntu:22.04 /bin/bash 7 days ago Up 25 hours desperate_dubinsky
48-
197387f1b436 ubuntu:22.04 /bin/bash 7 days ago Up 25 hours focused_hamilton
47+
c3f279d17e0a ubuntu:24.04 /bin/bash 7 days ago Up 25 hours desperate_dubinsky
48+
197387f1b436 ubuntu:24.04 /bin/bash 7 days ago Up 25 hours focused_hamilton
4949

5050
$ docker commit c3f279d17e0a svendowideit/testimage:version3
5151

@@ -63,8 +63,8 @@ svendowideit/testimage version3 f5283438590d 16 sec
6363
$ docker ps
6464

6565
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
66-
c3f279d17e0a ubuntu:22.04 /bin/bash 7 days ago Up 25 hours desperate_dubinsky
67-
197387f1b436 ubuntu:22.04 /bin/bash 7 days ago Up 25 hours focused_hamilton
66+
c3f279d17e0a ubuntu:24.04 /bin/bash 7 days ago Up 25 hours desperate_dubinsky
67+
197387f1b436 ubuntu:24.04 /bin/bash 7 days ago Up 25 hours focused_hamilton
6868

6969
$ docker inspect -f "{{ .Config.Env }}" c3f279d17e0a
7070

@@ -85,8 +85,8 @@ $ docker inspect -f "{{ .Config.Env }}" f5283438590d
8585
$ docker ps
8686

8787
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
88-
c3f279d17e0a ubuntu:22.04 /bin/bash 7 days ago Up 25 hours desperate_dubinsky
89-
197387f1b436 ubuntu:22.04 /bin/bash 7 days ago Up 25 hours focused_hamilton
88+
c3f279d17e0a ubuntu:24.04 /bin/bash 7 days ago Up 25 hours desperate_dubinsky
89+
197387f1b436 ubuntu:24.04 /bin/bash 7 days ago Up 25 hours focused_hamilton
9090

9191
$ docker commit --change='CMD ["apachectl", "-DFOREGROUND"]' -c "EXPOSE 80" c3f279d17e0a svendowideit/testimage:version4
9292

@@ -100,6 +100,6 @@ $ docker ps
100100

101101
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
102102
89373736e2e7 testimage:version4 "apachectl -DFOREGROU" 3 seconds ago Up 2 seconds 80/tcp distracted_fermat
103-
c3f279d17e0a ubuntu:22.04 /bin/bash 7 days ago Up 25 hours desperate_dubinsky
104-
197387f1b436 ubuntu:22.04 /bin/bash 7 days ago Up 25 hours focused_hamilton
103+
c3f279d17e0a ubuntu:24.04 /bin/bash 7 days ago Up 25 hours desperate_dubinsky
104+
197387f1b436 ubuntu:24.04 /bin/bash 7 days ago Up 25 hours focused_hamilton
105105
```

docs/reference/commandline/container_ls.md

+5-5
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ Running `docker ps --no-trunc` showing 2 linked containers.
3333
$ docker ps --no-trunc
3434

3535
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
36-
ca5534a51dd04bbcebe9b23ba05f389466cf0c190f1f8f182d7eea92a9671d00 ubuntu:22.04 bash 17 seconds ago Up 16 seconds 3300-3310/tcp webapp
36+
ca5534a51dd04bbcebe9b23ba05f389466cf0c190f1f8f182d7eea92a9671d00 ubuntu:24.04 bash 17 seconds ago Up 16 seconds 3300-3310/tcp webapp
3737
9ca9747b233100676a48cc7806131586213fa5dab86dd1972d6a8732e3a84a4d crosbymichael/redis:latest /redis-server --dir 33 minutes ago Up 33 minutes 6379/tcp redis,webapp/db
3838
```
3939

@@ -240,13 +240,13 @@ CONTAINER ID IMAGE COMMAND CREATED
240240
919e1179bdb8 ubuntu-c1 "top" About a minute ago Up About a minute admiring_lovelace
241241
```
242242

243-
Match containers based on the `ubuntu` version `22.04` image:
243+
Match containers based on the `ubuntu` version `24.04` image:
244244

245245
```console
246-
$ docker ps --filter ancestor=ubuntu:22.04
246+
$ docker ps --filter ancestor=ubuntu:24.04
247247

248248
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
249-
82a598284012 ubuntu:22.04 "top" 3 minutes ago Up 3 minutes sleepy_bose
249+
82a598284012 ubuntu:24.04 "top" 3 minutes ago Up 3 minutes sleepy_bose
250250
```
251251

252252
The following matches containers based on the layer `d0e008c6cf02` or an image
@@ -256,7 +256,7 @@ that have this layer in its layer stack.
256256
$ docker ps --filter ancestor=d0e008c6cf02
257257

258258
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
259-
82a598284012 ubuntu:22.04 "top" 3 minutes ago Up 3 minutes sleepy_bose
259+
82a598284012 ubuntu:24.04 "top" 3 minutes ago Up 3 minutes sleepy_bose
260260
```
261261

262262
#### Create time

docs/reference/commandline/image_pull.md

+20-22
Original file line numberDiff line numberDiff line change
@@ -107,8 +107,8 @@ refer to [understand images, containers, and storage drivers](https://docs.docke
107107
So far, you've pulled images by their name (and "tag"). Using names and tags is
108108
a convenient way to work with images. When using tags, you can `docker pull` an
109109
image again to make sure you have the most up-to-date version of that image.
110-
For example, `docker pull ubuntu:22.04` pulls the latest version of the Ubuntu
111-
22.04 image.
110+
For example, `docker pull ubuntu:24.04` pulls the latest version of the Ubuntu
111+
24.04 image.
112112

113113
In some cases you don't want images to be updated to newer versions, but prefer
114114
to use a fixed version of an image. Docker enables you to pull an image by its
@@ -117,23 +117,23 @@ of an image to pull. Doing so, allows you to "pin" an image to that version,
117117
and guarantee that the image you're using is always the same.
118118

119119
To know the digest of an image, pull the image first. Let's pull the latest
120-
`ubuntu:22.04` image from Docker Hub:
120+
`ubuntu:24.04` image from Docker Hub:
121121

122122
```console
123-
$ docker pull ubuntu:22.04
123+
$ docker pull ubuntu:24.04
124124

125-
22.04: Pulling from library/ubuntu
125+
24.04: Pulling from library/ubuntu
126126
125a6e411906: Pull complete
127-
Digest: sha256:26c68657ccce2cb0a31b330cb0be2b5e108d467f641c62e13ab40cbec258c68d
128-
Status: Downloaded newer image for ubuntu:22.04
129-
docker.io/library/ubuntu:22.04
127+
Digest: sha256:2e863c44b718727c860746568e1d54afd13b2fa71b160f5cd9058fc436217b30
128+
Status: Downloaded newer image for ubuntu:24.04
129+
docker.io/library/ubuntu:24.04
130130
```
131131

132132
Docker prints the digest of the image after the pull has finished. In the example
133133
above, the digest of the image is:
134134

135135
```console
136-
sha256:26c68657ccce2cb0a31b330cb0be2b5e108d467f641c62e13ab40cbec258c68d
136+
sha256:2e863c44b718727c860746568e1d54afd13b2fa71b160f5cd9058fc436217b30
137137
```
138138

139139
Docker also prints the digest of an image when pushing to a registry. This
@@ -143,18 +143,18 @@ A digest takes the place of the tag when pulling an image, for example, to
143143
pull the above image by digest, run the following command:
144144

145145
```console
146-
$ docker pull ubuntu@sha256:26c68657ccce2cb0a31b330cb0be2b5e108d467f641c62e13ab40cbec258c68d
146+
$ docker pull ubuntu@sha256:2e863c44b718727c860746568e1d54afd13b2fa71b160f5cd9058fc436217b30
147147

148-
docker.io/library/ubuntu@sha256:26c68657ccce2cb0a31b330cb0be2b5e108d467f641c62e13ab40cbec258c68d: Pulling from library/ubuntu
149-
Digest: sha256:26c68657ccce2cb0a31b330cb0be2b5e108d467f641c62e13ab40cbec258c68d
150-
Status: Image is up to date for ubuntu@sha256:26c68657ccce2cb0a31b330cb0be2b5e108d467f641c62e13ab40cbec258c68d
151-
docker.io/library/ubuntu@sha256:26c68657ccce2cb0a31b330cb0be2b5e108d467f641c62e13ab40cbec258c68d
148+
docker.io/library/ubuntu@sha256:2e863c44b718727c860746568e1d54afd13b2fa71b160f5cd9058fc436217b30: Pulling from library/ubuntu
149+
Digest: sha256:2e863c44b718727c860746568e1d54afd13b2fa71b160f5cd9058fc436217b30
150+
Status: Image is up to date for ubuntu@sha256:2e863c44b718727c860746568e1d54afd13b2fa71b160f5cd9058fc436217b30
151+
docker.io/library/ubuntu@sha256:2e863c44b718727c860746568e1d54afd13b2fa71b160f5cd9058fc436217b30
152152
```
153153

154154
Digest can also be used in the `FROM` of a Dockerfile, for example:
155155

156156
```dockerfile
157-
FROM ubuntu@sha256:26c68657ccce2cb0a31b330cb0be2b5e108d467f641c62e13ab40cbec258c68d
157+
FROM ubuntu@sha256:2e863c44b718727c860746568e1d54afd13b2fa71b160f5cd9058fc436217b30
158158
LABEL org.opencontainers.image.authors="some maintainer <[email protected]>"
159159
```
160160

@@ -215,13 +215,11 @@ shorthand) to see the images that were pulled. The example below shows all the
215215
```console
216216
$ docker image ls --filter reference=ubuntu
217217
REPOSITORY TAG IMAGE ID CREATED SIZE
218-
ubuntu 18.04 c6ad7e71ba7d 5 weeks ago 63.2MB
219-
ubuntu bionic c6ad7e71ba7d 5 weeks ago 63.2MB
220-
ubuntu 22.04 5ccefbfc0416 2 months ago 78MB
221-
ubuntu focal ff0fea8310f3 2 months ago 72.8MB
222-
ubuntu latest ff0fea8310f3 2 months ago 72.8MB
223-
ubuntu jammy 41ba606c8ab9 3 months ago 79MB
224-
ubuntu 20.04 ba6acccedd29 7 months ago 72.8MB
218+
ubuntu 22.04 8a3cdc4d1ad3 3 weeks ago 77.9MB
219+
ubuntu jammy 8a3cdc4d1ad3 3 weeks ago 77.9MB
220+
ubuntu 24.04 35a88802559d 6 weeks ago 78.1MB
221+
ubuntu latest 35a88802559d 6 weeks ago 78.1MB
222+
ubuntu noble 35a88802559d 6 weeks ago 78.1MB
225223
```
226224

227225
### Cancel a pull

docs/reference/commandline/service_create.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -699,7 +699,7 @@ follows:
699699
| `node.platform.os` | Node operating system | `node.platform.os==windows` |
700700
| `node.platform.arch` | Node architecture | `node.platform.arch==x86_64` |
701701
| `node.labels` | User-defined node labels | `node.labels.security==high` |
702-
| `engine.labels` | Docker Engine's labels | `engine.labels.operatingsystem==ubuntu-22.04` |
702+
| `engine.labels` | Docker Engine's labels | `engine.labels.operatingsystem==ubuntu-24.04` |
703703

704704
`engine.labels` apply to Docker Engine labels like operating system, drivers,
705705
etc. Swarm administrators add `node.labels` for operational purposes by using

docs/reference/commandline/system_events.md

+4-4
Original file line numberDiff line numberDiff line change
@@ -339,10 +339,10 @@ $ docker events --filter 'type=network'
339339

340340
$ docker events --filter 'container=container_1' --filter 'container=container_2'
341341

342-
2014-09-03T15:49:29.999999999Z07:00 container die 4386fb97867d (image=ubuntu:22.04)
343-
2014-05-10T17:42:14.999999999Z07:00 container stop 4386fb97867d (image=ubuntu:22.04)
344-
2014-05-10T17:42:14.999999999Z07:00 container die 7805c1d35632 (imager=redis:2.8)
345-
2014-09-03T15:49:29.999999999Z07:00 container stop 7805c1d35632 (image=redis:2.8)
342+
2014-09-03T15:49:29.999999999Z07:00 container die 4386fb97867d (image=ubuntu:24.04)
343+
2014-05-10T17:42:14.999999999Z07:00 container stop 4386fb97867d (image=ubuntu:24.04)
344+
2014-05-10T17:42:14.999999999Z07:00 container die 7805c1d35632 (imager=redis:7.2)
345+
2014-09-03T15:49:29.999999999Z07:00 container stop 7805c1d35632 (image=redis:7.2)
346346

347347
$ docker events --filter 'type=volume'
348348

docs/reference/run.md

+21-21
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ reference to create or run a container based on an image.
3535

3636
An image tag is the image version, which defaults to `latest` when omitted. Use
3737
the tag to run a container from specific version of an image. For example, to
38-
run version `23.10` of the `ubuntu` image: `docker run ubuntu:23.10`.
38+
run version `24.04` of the `ubuntu` image: `docker run ubuntu:24.04`.
3939

4040
#### Image digests
4141

@@ -400,22 +400,22 @@ We have four ways to set user memory usage:
400400
Examples:
401401

402402
```console
403-
$ docker run -it ubuntu:22.04 /bin/bash
403+
$ docker run -it ubuntu:24.04 /bin/bash
404404
```
405405

406406
We set nothing about memory, this means the processes in the container can use
407407
as much memory and swap memory as they need.
408408

409409
```console
410-
$ docker run -it -m 300M --memory-swap -1 ubuntu:22.04 /bin/bash
410+
$ docker run -it -m 300M --memory-swap -1 ubuntu:24.04 /bin/bash
411411
```
412412

413413
We set memory limit and disabled swap memory limit, this means the processes in
414414
the container can use 300M memory and as much swap memory as they need (if the
415415
host supports swap memory).
416416

417417
```console
418-
$ docker run -it -m 300M ubuntu:22.04 /bin/bash
418+
$ docker run -it -m 300M ubuntu:24.04 /bin/bash
419419
```
420420

421421
We set memory limit only, this means the processes in the container can use
@@ -424,7 +424,7 @@ We set memory limit only, this means the processes in the container can use
424424
would be 2*300M, so processes can use 300M swap memory as well.
425425

426426
```console
427-
$ docker run -it -m 300M --memory-swap 1G ubuntu:22.04 /bin/bash
427+
$ docker run -it -m 300M --memory-swap 1G ubuntu:24.04 /bin/bash
428428
```
429429

430430
We set both memory and swap memory, so the processes in the container can use
@@ -450,7 +450,7 @@ The following example limits the memory (`-m`) to 500M and sets the memory
450450
reservation to 200M.
451451

452452
```console
453-
$ docker run -it -m 500M --memory-reservation 200M ubuntu:22.04 /bin/bash
453+
$ docker run -it -m 500M --memory-reservation 200M ubuntu:24.04 /bin/bash
454454
```
455455

456456
Under this configuration, when the container consumes memory more than 200M and
@@ -460,7 +460,7 @@ memory below 200M.
460460
The following example set memory reservation to 1G without a hard memory limit.
461461

462462
```console
463-
$ docker run -it --memory-reservation 1G ubuntu:22.04 /bin/bash
463+
$ docker run -it --memory-reservation 1G ubuntu:24.04 /bin/bash
464464
```
465465

466466
The container can use as much memory as it needs. The memory reservation setting
@@ -478,13 +478,13 @@ The following example limits the memory to 100M and disables the OOM killer for
478478
this container:
479479

480480
```console
481-
$ docker run -it -m 100M --oom-kill-disable ubuntu:22.04 /bin/bash
481+
$ docker run -it -m 100M --oom-kill-disable ubuntu:24.04 /bin/bash
482482
```
483483

484484
The following example, illustrates a dangerous way to use the flag:
485485

486486
```console
487-
$ docker run -it --oom-kill-disable ubuntu:22.04 /bin/bash
487+
$ docker run -it --oom-kill-disable ubuntu:24.04 /bin/bash
488488
```
489489

490490
The container has unlimited memory which can cause the host to run out memory
@@ -554,14 +554,14 @@ limit and "K" the kernel limit. There are three possible ways to set limits:
554554
Examples:
555555

556556
```console
557-
$ docker run -it -m 500M --kernel-memory 50M ubuntu:22.04 /bin/bash
557+
$ docker run -it -m 500M --kernel-memory 50M ubuntu:24.04 /bin/bash
558558
```
559559

560560
We set memory and kernel memory, so the processes in the container can use
561561
500M memory in total, in this 500M memory, it can be 50M kernel memory tops.
562562

563563
```console
564-
$ docker run -it --kernel-memory 50M ubuntu:22.04 /bin/bash
564+
$ docker run -it --kernel-memory 50M ubuntu:24.04 /bin/bash
565565
```
566566

567567
We set kernel memory without **-m**, so the processes in the container can
@@ -578,7 +578,7 @@ between 0 and 100. A value of 0 turns off anonymous page swapping. A value of
578578
For example, you can set:
579579

580580
```console
581-
$ docker run -it --memory-swappiness=0 ubuntu:22.04 /bin/bash
581+
$ docker run -it --memory-swappiness=0 ubuntu:24.04 /bin/bash
582582
```
583583

584584
Setting the `--memory-swappiness` option is helpful when you want to retain the
@@ -629,7 +629,7 @@ And usually `--cpu-period` should work with `--cpu-quota`.
629629
Examples:
630630

631631
```console
632-
$ docker run -it --cpu-period=50000 --cpu-quota=25000 ubuntu:22.04 /bin/bash
632+
$ docker run -it --cpu-period=50000 --cpu-quota=25000 ubuntu:24.04 /bin/bash
633633
```
634634

635635
If there is 1 CPU, this means the container can get 50% CPU worth of run-time every 50ms.
@@ -650,13 +650,13 @@ We can set cpus in which to allow execution for containers.
650650
Examples:
651651

652652
```console
653-
$ docker run -it --cpuset-cpus="1,3" ubuntu:22.04 /bin/bash
653+
$ docker run -it --cpuset-cpus="1,3" ubuntu:24.04 /bin/bash
654654
```
655655

656656
This means processes in container can be executed on cpu 1 and cpu 3.
657657

658658
```console
659-
$ docker run -it --cpuset-cpus="0-2" ubuntu:22.04 /bin/bash
659+
$ docker run -it --cpuset-cpus="0-2" ubuntu:24.04 /bin/bash
660660
```
661661

662662
This means processes in container can be executed on cpu 0, cpu 1 and cpu 2.
@@ -667,14 +667,14 @@ on NUMA systems.
667667
Examples:
668668

669669
```console
670-
$ docker run -it --cpuset-mems="1,3" ubuntu:22.04 /bin/bash
670+
$ docker run -it --cpuset-mems="1,3" ubuntu:24.04 /bin/bash
671671
```
672672

673673
This example restricts the processes in the container to only use memory from
674674
memory nodes 1 and 3.
675675

676676
```console
677-
$ docker run -it --cpuset-mems="0-2" ubuntu:22.04 /bin/bash
677+
$ docker run -it --cpuset-mems="0-2" ubuntu:24.04 /bin/bash
678678
```
679679

680680
This example restricts the processes in the container to only use memory from
@@ -706,8 +706,8 @@ For example, the commands below create two containers with different blkio
706706
weight:
707707

708708
```console
709-
$ docker run -it --name c1 --blkio-weight 300 ubuntu:22.04 /bin/bash
710-
$ docker run -it --name c2 --blkio-weight 600 ubuntu:22.04 /bin/bash
709+
$ docker run -it --name c1 --blkio-weight 300 ubuntu:24.04 /bin/bash
710+
$ docker run -it --name c2 --blkio-weight 600 ubuntu:24.04 /bin/bash
711711
```
712712

713713
If you do block IO in the two containers at the same time, by, for example:
@@ -923,11 +923,11 @@ For interacting with the network stack, instead of using `--privileged` they
923923
should use `--cap-add=NET_ADMIN` to modify the network interfaces.
924924

925925
```console
926-
$ docker run -it --rm ubuntu:22.04 ip link add dummy0 type dummy
926+
$ docker run -it --rm ubuntu:24.04 ip link add dummy0 type dummy
927927

928928
RTNETLINK answers: Operation not permitted
929929

930-
$ docker run -it --rm --cap-add=NET_ADMIN ubuntu:22.04 ip link add dummy0 type dummy
930+
$ docker run -it --rm --cap-add=NET_ADMIN ubuntu:24.04 ip link add dummy0 type dummy
931931
```
932932

933933
To mount a FUSE based filesystem, you need to combine both `--cap-add` and

man/src/container/attach.md

+6-9
Original file line numberDiff line numberDiff line change
@@ -21,16 +21,13 @@ In this example the top command is run inside a container from an ubuntu image,
2121
in detached mode, then attaches to it, and then terminates the container
2222
with `CTRL-c`:
2323

24-
$ docker run -d --name topdemo ubuntu:20.04 /usr/bin/top -b
24+
$ docker run -d --name topdemo alpine top -b
2525
$ docker attach topdemo
26-
top - 00:07:01 up 4:54, 0 users, load average: 0.83, 0.91, 0.82
27-
Tasks: 1 total, 1 running, 0 sleeping, 0 stopped, 0 zombie
28-
%Cpu(s): 2.3 us, 1.6 sy, 0.0 ni, 95.9 id, 0.0 wa, 0.1 hi, 0.1 si, 0.0 st
29-
MiB Mem : 15846.2 total, 5729.2 free, 2592.5 used, 7524.4 buff/cache
30-
MiB Swap: 16384.0 total, 16384.0 free, 0.0 used. 12097.3 avail Mem
31-
32-
PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND
33-
1 root 20 0 5976 3256 2828 R 0.0 0.0 0:00.04 top
26+
Mem: 2395856K used, 5638884K free, 2328K shrd, 61904K buff, 1524264K cached
27+
CPU: 0% usr 0% sys 0% nic 99% idle 0% io 0% irq 0% sirq
28+
Load average: 0.15 0.06 0.01 1/567 6
29+
PID PPID USER STAT VSZ %VSZ CPU %CPU COMMAND
30+
1 0 root R 1700 0% 3 0% top -b
3431
^C
3532

3633
## Override the detach sequence

0 commit comments

Comments
 (0)