@@ -35,7 +35,7 @@ reference to create or run a container based on an image.
35
35
36
36
An image tag is the image version, which defaults to ` latest ` when omitted. Use
37
37
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 ` .
39
39
40
40
#### Image digests
41
41
@@ -400,22 +400,22 @@ We have four ways to set user memory usage:
400
400
Examples:
401
401
402
402
``` console
403
- $ docker run -it ubuntu:22 .04 /bin/bash
403
+ $ docker run -it ubuntu:24 .04 /bin/bash
404
404
```
405
405
406
406
We set nothing about memory, this means the processes in the container can use
407
407
as much memory and swap memory as they need.
408
408
409
409
``` 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
411
411
```
412
412
413
413
We set memory limit and disabled swap memory limit, this means the processes in
414
414
the container can use 300M memory and as much swap memory as they need (if the
415
415
host supports swap memory).
416
416
417
417
``` console
418
- $ docker run -it -m 300M ubuntu:22 .04 /bin/bash
418
+ $ docker run -it -m 300M ubuntu:24 .04 /bin/bash
419
419
```
420
420
421
421
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
424
424
would be 2* 300M, so processes can use 300M swap memory as well.
425
425
426
426
``` 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
428
428
```
429
429
430
430
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
450
450
reservation to 200M.
451
451
452
452
``` 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
454
454
```
455
455
456
456
Under this configuration, when the container consumes memory more than 200M and
@@ -460,7 +460,7 @@ memory below 200M.
460
460
The following example set memory reservation to 1G without a hard memory limit.
461
461
462
462
``` 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
464
464
```
465
465
466
466
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
478
478
this container:
479
479
480
480
``` 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
482
482
```
483
483
484
484
The following example, illustrates a dangerous way to use the flag:
485
485
486
486
``` 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
488
488
```
489
489
490
490
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:
554
554
Examples:
555
555
556
556
``` 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
558
558
```
559
559
560
560
We set memory and kernel memory, so the processes in the container can use
561
561
500M memory in total, in this 500M memory, it can be 50M kernel memory tops.
562
562
563
563
``` 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
565
565
```
566
566
567
567
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
578
578
For example, you can set:
579
579
580
580
``` 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
582
582
```
583
583
584
584
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`.
629
629
Examples:
630
630
631
631
``` 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
633
633
```
634
634
635
635
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.
650
650
Examples:
651
651
652
652
``` 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
654
654
```
655
655
656
656
This means processes in container can be executed on cpu 1 and cpu 3.
657
657
658
658
``` 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
660
660
```
661
661
662
662
This means processes in container can be executed on cpu 0, cpu 1 and cpu 2.
@@ -667,14 +667,14 @@ on NUMA systems.
667
667
Examples:
668
668
669
669
``` 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
671
671
```
672
672
673
673
This example restricts the processes in the container to only use memory from
674
674
memory nodes 1 and 3.
675
675
676
676
``` 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
678
678
```
679
679
680
680
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
706
706
weight:
707
707
708
708
``` 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
711
711
```
712
712
713
713
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
923
923
should use ` --cap-add=NET_ADMIN ` to modify the network interfaces.
924
924
925
925
``` 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
927
927
928
928
RTNETLINK answers: Operation not permitted
929
929
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
931
931
```
932
932
933
933
To mount a FUSE based filesystem, you need to combine both ` --cap-add ` and
0 commit comments