Implementing DevOps Solutions and Practices Using Cisco Platforms (DEVOPS) — Question 14

Which Docker command is used to start an interactive Bash shell in a running container named "test"?

Answer options

Correct answer: C

Explanation

The correct command is 'docker exec -it test /bin/bash' because it allows execution of a command in an already running container. 'docker attach' connects to the running container's console but doesn't start a new Bash shell, while 'docker run' creates a new container rather than accessing an existing one.