CompTIA Linux+ (XK0-005) — Question 239
A new application container was built with an incorrect version number. Which of the following commands should be used to rename the image to match the correct version 2.1.2?
Answer options
- A. docker tag comptia/app:2.1.1 comptia/app:2.1.2
- B. docker push comptia/app:2.1.1 comptia/app:2.1.2
- C. docker rmi comptia/app:2.1.1 comptia/app:2.1.2
- D. docker update comptia/app:2.1.1 comptia/app:2.1.2
Correct answer: A
Explanation
The correct answer is A because the 'docker tag' command is used to create a new tag for an existing image, effectively renaming it. The other options are incorrect as 'docker push' is for uploading images, 'docker rmi' is for removing images, and 'docker update' does not apply to image tagging.