What does the command 'docker run --rm nginx' do?

Prepare for the KCNA Certification Test. Study with flashcards, multiple-choice questions, and detailed explanations to enhance your understanding of Kubernetes Cloud Native concepts. Ace your exam!

Multiple Choice

What does the command 'docker run --rm nginx' do?

Explanation:
The --rm flag makes Docker clean up the container after it finishes. In this command, Docker will pull the nginx image if it isn’t already on the system, run a container from that image (nginx starts in the foreground by default), and then automatically remove the container when nginx exits. The image itself stays in your local cache, and you won’t get an interactive shell unless you explicitly request one.

The --rm flag makes Docker clean up the container after it finishes. In this command, Docker will pull the nginx image if it isn’t already on the system, run a container from that image (nginx starts in the foreground by default), and then automatically remove the container when nginx exits. The image itself stays in your local cache, and you won’t get an interactive shell unless you explicitly request one.

Subscribe

Get the latest from Examzify

You can unsubscribe at any time. Read our privacy policy