0
0
Dockerdevops~10 mins

Container disk usage management 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 list disk usage of Docker images.

Docker
docker system [1]
Drag options to blanks, or click blank then click option'
Adf
Bimages
Cprune
Dps
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'prune' which deletes unused data instead of showing usage.
Using 'images' which lists images but does not show disk usage.
Using 'ps' which lists containers but not disk usage.
2fill in blank
medium

Complete the command to remove all stopped containers and unused images.

Docker
docker system [1]
Drag options to blanks, or click blank then click option'
Adf
Brm
Cprune
Dclean
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'df' which only shows disk usage.
Using 'rm' which removes specific containers or images but not system-wide.
Using 'clean' which is not a valid Docker command.
3fill in blank
hard

Fix the error in the command to remove dangling images.

Docker
docker image rm $(docker images -f "dangling=[1]" -q)
Drag options to blanks, or click blank then click option'
Atrue
Bfalse
Cnone
Dall
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'false' which selects non-dangling images.
Using 'none' or 'all' which are invalid filter values.
4fill in blank
hard

Fill both blanks to create a command that removes all unused volumes and networks.

Docker
docker volume [1] && docker network [2]
Drag options to blanks, or click blank then click option'
Aprune
Brm
Clist
Dinspect
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'rm' which removes specific named resources, not all unused ones.
Using 'list' or 'inspect' which only show information.
5fill in blank
hard

Fill all three blanks to create a dictionary comprehension that maps container IDs to their size if size is greater than 100MB.

Docker
sizes = [1]: [2] for c in containers if c['SizeRootFs'] [3] 100*1024*1024
Drag options to blanks, or click blank then click option'
Ac['Id']
Bc['SizeRootFs']
C>
D<
Attempts:
3 left
💡 Hint
Common Mistakes
Using '<' instead of '>' which selects smaller containers.
Using wrong keys or values that do not exist.