312-97 practice question 20 of 35

(Rockmond Dunbar is a senior DevSecOps engineer in a software development company. His organization develops customized software for retail…

Full set: 100 questions
(Rockmond Dunbar is a senior DevSecOps engineer in a software development company. His organization develops customized software for retail industries. Rockmond would like to avoid setting mount propagation mode to share until it is required because when a volume is mounted in shared mode, it does not limit other containers to mount and modify that volume. If mounted volume is sensitive to changes, then it would be a serious security concern. Which of the following commands should Rockmond run to list out the propagation mode for mounted volumes?.)
Answer options
A: docker ps -quiet -all | xargs docker inspect -format ': Propagation='.
B: docker ps --quiet --all | xargs docker inspect --format ': Propagation'.
C: docker ps --quiet --all | xargs docker inspect --format ': Propagation='. Correct answer
D: docker ps -quiet -all | xargs docker inspect -format ': Propagation'.
Correct Answer:
C. docker ps --quiet --all | xargs docker inspect --format ': Propagation='.
Explanation

The correct way to view the mount propagation of every container is to pipe the IDs produced by “docker ps --quiet --all” into “docker inspect --format ': Propagation='”. Both --quiet/--all and --format require double dashes; the equals sign labels the reported value.

Why Incorrect

A. Uses single-dash long options; Docker recognises only double dashes.
B. Omits “=” label, giving unclear output.
D. Combines invalid single-dash options with missing “=” label; will error.

References

1. Docker Documentation, “Bind propagation”, docs.docker.com/storage/bind-mounts/#configure-bind-propagation, Example showing “docker ps --quiet --all | xargs docker inspect --format …”, accessed 2024-04-09.

2. MIT 6.824 Lab Notes, “Container Mounts and Propagation”, Spring 2023, p.4.

Scroll to Top