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

Study for the Kubernetes Cloud Native Associate (KCNA) Certification 1 Test. Master the core concepts of Kubernetes with multiple-choice questions and detailed explanations. Prepare and boost your confidence for the KCNA certification 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