Q. How can you check the health status of a running container?

  • (A) docker health container_name
  • (B) docker inspect container_name
  • (C) docker status container_name
  • (D) docker logs container_name
πŸ’¬ Discuss
βœ… Correct Answer: (B) docker inspect container_name
Explanation: 'docker inspect container_name' provides detailed information, including the health status, of a running container.

Q. Which of the following is true about Docker images?

  • (A) Docker images are always ephemeral
  • (B) Docker images are a snapshot of a filesystem with dependencies
  • (C) Docker images are containers in themselves
  • (D) Docker images do not contain any software dependencies
πŸ’¬ Discuss
βœ… Correct Answer: (B) Docker images are a snapshot of a filesystem with dependencies
Explanation: Docker images contain the application and its dependencies, forming a snapshot of a filesystem.

Q. Which Docker command is used to list the available Docker volumes?

  • (A) docker volume ls
  • (B) docker list volumes
  • (C) docker show volumes
  • (D) docker volume show
πŸ’¬ Discuss
βœ… Correct Answer: (A) docker volume ls
Explanation: 'docker volume ls' is used to list all available Docker volumes.

Q. Which command is used to get the IP address of a running Docker container?

  • (A) docker container ip container_name
  • (B) docker inspect container_name | grep IP
  • (C) docker ip container_name
  • (D) docker network inspect container_name
πŸ’¬ Discuss
βœ… Correct Answer: (B) docker inspect container_name | grep IP
Explanation: 'docker inspect container_name | grep IP' will retrieve the IP address of a running container.

Q. How can you view the processes running inside a Docker container?

  • (A) docker ps
  • (B) docker process
  • (C) docker exec -it container_name ps
  • (D) docker inspect container_name
πŸ’¬ Discuss
βœ… Correct Answer: (C) docker exec -it container_name ps
Explanation: 'docker exec -it container_name ps' is used to view the processes running inside a container.

Q. Which of the following statements is correct about Docker Swarm?

  • (A) Docker Swarm is used to orchestrate and manage a cluster of Docker nodes
  • (B) Docker Swarm is used to build Docker images
  • (C) Docker Swarm is used for local container storage management
  • (D) Docker Swarm is only available for Windows-based systems
πŸ’¬ Discuss
βœ… Correct Answer: (A) Docker Swarm is used to orchestrate and manage a cluster of Docker nodes
Explanation: Docker Swarm is a native Docker clustering tool for managing multiple Docker nodes and containers.

Q. What is the purpose of the 'docker pause' command?

  • (A) To stop a container permanently
  • (B) To pause all processes in a running container
  • (C) To stop a container gracefully
  • (D) To delete a container
πŸ’¬ Discuss
βœ… Correct Answer: (B) To pause all processes in a running container
Explanation: The 'docker pause' command pauses all processes in a running container. Use 'docker unpause' to resume the container.

Q. Which command is used to rename a Docker container?

  • (A) docker rename
  • (B) docker container rename
  • (C) docker update
  • (D) docker modify
πŸ’¬ Discuss
βœ… Correct Answer: (B) docker container rename
Explanation: The 'docker container rename' command is used to rename a Docker container. For example, 'docker container rename old_name new_name'.

Q. What is the purpose of the 'docker-compose restart' command?

  • (A) To restart all containers defined in a docker-compose.yml file
  • (B) To rebuild Docker images
  • (C) To stop and remove containers
  • (D) To push images to Docker Hub
πŸ’¬ Discuss
βœ… Correct Answer: (A) To restart all containers defined in a docker-compose.yml file
Explanation: The 'docker-compose restart' command restarts all running containers defined in the 'docker-compose.yml' file.

Q. Which command is used to view the Docker version and system information?

  • (A) docker info
  • (B) docker version
  • (C) docker system info
  • (D) docker inspect
πŸ’¬ Discuss
βœ… Correct Answer: (B) docker version
Explanation: The 'docker version' command displays the Docker version and system information, including the client and server versions.