0
0
Dockerdevops~10 mins

CPU limits and reservations in Docker - Interactive Code Practice

Choose your learning style9 modes available
Practice - 5 Tasks
Answer the questions below
1fill in blank
easy

Complete the command to set a CPU limit of 0.5 cores for a Docker container.

Docker
docker run --cpus=[1] nginx
Drag options to blanks, or click blank then click option'
A0.5
B1
C2
D0.1
Attempts:
3 left
💡 Hint
Common Mistakes
Using an integer like 1 which allows full CPU usage.
Using a value greater than the available CPU cores.
2fill in blank
medium

Complete the command to reserve 0.25 CPU cores for a Docker container.

Docker
docker run --cpu-reservation=[1] nginx
Drag options to blanks, or click blank then click option'
A1
B2
C0.25
D0.5
Attempts:
3 left
💡 Hint
Common Mistakes
Confusing CPU limit with CPU reservation.
Using a value larger than the CPU limit.
3fill in blank
hard

Fix the error in the command to limit CPU usage to 1.5 cores.

Docker
docker run --cpus=[1] nginx
Drag options to blanks, or click blank then click option'
A1.5
B1,5
C1-5
D15
Attempts:
3 left
💡 Hint
Common Mistakes
Using a comma instead of a dot for decimals.
Using a dash or other invalid characters.
4fill in blank
hard

Fill both blanks to set a CPU limit of 2 cores and reserve 1 core for a Docker container.

Docker
docker run --cpus=[1] --cpu-reservation=[2] nginx
Drag options to blanks, or click blank then click option'
A2
B1
C0.5
D3
Attempts:
3 left
💡 Hint
Common Mistakes
Setting reservation higher than the limit.
Using fractional values when whole cores are intended.
5fill in blank
hard

Fill all three blanks to run a container with CPU limit 1.2, CPU reservation 0.8, and name it 'webapp'.

Docker
docker run --cpus=[1] --cpu-reservation=[2] --name=[3] nginx
Drag options to blanks, or click blank then click option'
A1.2
B0.8
Cwebapp
Dnginx
Attempts:
3 left
💡 Hint
Common Mistakes
Using the image name as the container name.
Mixing up CPU limit and reservation values.