0
0
Dockerdevops~10 mins

Why resource limits matter in Docker - Test Your Understanding

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

Complete the command to limit the CPU usage of a Docker container to 50%.

Docker
docker run --cpus=[1] alpine top
Drag options to blanks, or click blank then click option'
A2
B0.5
C1
D4
Attempts:
3 left
💡 Hint
Common Mistakes
Using an integer greater than 1 to limit CPU to less than one core.
Omitting the --cpus flag.
2fill in blank
medium

Complete the command to limit the memory usage of a Docker container to 256 megabytes.

Docker
docker run --memory=[1] alpine top
Drag options to blanks, or click blank then click option'
A256mbs
B256mb
C256m
D256
Attempts:
3 left
💡 Hint
Common Mistakes
Using mb or mbs which are invalid units.
Not specifying any unit, which defaults to bytes and is too small.
3fill in blank
hard

Fix the error in the command that tries to limit memory but uses an invalid unit.

Docker
docker run --memory=[1] alpine top
Drag options to blanks, or click blank then click option'
A512m
B512mb
C512mbs
D512
Attempts:
3 left
💡 Hint
Common Mistakes
Using mb or mbs as units.
Omitting the unit entirely.
4fill in blank
hard

Fill both blanks to limit CPU to 1.5 cores and memory to 1 gigabyte.

Docker
docker run --cpus=[1] --memory=[2] alpine top
Drag options to blanks, or click blank then click option'
A1.5
B1g
C1.0g
D2
Attempts:
3 left
💡 Hint
Common Mistakes
Using 1.0g which is valid but less common.
Using 2 for memory which lacks a unit.
5fill in blank
hard

Fill all three blanks to run a container with CPU limit 0.75, memory limit 512 megabytes, and a restart policy of always.

Docker
docker run --cpus=[1] --memory=[2] --restart=[3] alpine top
Drag options to blanks, or click blank then click option'
A0.75
B512m
Calways
Don-failure
Attempts:
3 left
💡 Hint
Common Mistakes
Using 512mb instead of 512m.
Using on-failure when the question asks for always.