Which feature of Docker allows you to track different versions of your application?
Isolation
Portability
Version Control
Resource Efficiency
What is the primary purpose of a Docker image?
To provide a writable instance of an application that runs on the host machine
To define the instructions for building a Docker image, including dependencies and configurations
To enable communication between containers on different hosts
To serve as a cloud-based repository for storing and sharing Docker images
In the context of Docker, which command would you use to create a container from a specific image and also assign a name to that container?
docker build
docker run
docker pull
docker ps
If you wanted to see the live resource usage statistics of all running containers, which command would you use?
docker stats
docker logs
docker rm
docker exec
What is the purpose of the docker run command?
To build a Docker image from a Dockerfile
To create and start a container from a specified image
To remove a Docker image from the local machine
To display a live stream of container resource usage statistics
Which command would you use to remove a stopped container?
docker stop
docker rmi
docker start
Imagine you're setting up a Docker container using Ubuntu as the base image. If you wanted to ensure that the package installations occur without any interactive prompts, which command would you include in your Dockerfile to set the appropriate environment variable?
RUN apt-get install -y curl vim git
ENV DEBIAN_FRONTEND=noninteractive
FROM ubuntu
WORKDIR /root
After creating your Dockerfile and building your image, you want to ensure the container runs in an interactive terminal. Which combination of options would you use with the docker run command to achieve this?
-d --name my-ubuntu-container
-it --name my-ubuntu-container
-it -d
--name my-ubuntu-container -e
You’ve built a Docker image named my-ubuntu-image. To confirm that this image has been successfully created, which command would you execute to view a list of all Docker images?
docker images
docker container list
docker ls
You're working on a project that involves multiple services, such as a web server and a database. Instead of managing each container individually, you've decided to use a tool that allows you to define and configure all these services in a single, readable file format. Which tool should you consider using to streamline the management of your multi-container application?
Docker CLI
Docker Swarm
Docker Compose
Kubernetes
What command would you use to run a Docker Compose file named my-compose-file.yml?
docker-compose start my-compose-file.yml
docker-composese -f my-compose-file.yml up
docker-compose my-compose-file.yml
docker-compose runup my-compose-file.yml
How would you scale the web service to run three instances using Docker Compose?
docker-compose up --replica web=3
docker-compose scale web=3
docker-compose up --scale web=3
docker-compose up --instances web=3