If you launch a container with '--network none' and later need to give it network access, what should you do?
Explanation:
You can dynamically add or remove a container from a network using 'docker network connect' and 'docker network disconnect' even after the container is created.
What is a Docker image?
Explanation:
A Docker image serves as a blueprint containing the application code, libraries, dependencies, and configurations needed to create a Docker container.
What's the purpose of the -d
flag when running a Docker container?
Explanation:
-d
stands for 'detached'. When you use this flag, the container runs in the background, freeing up your terminal.
When should you consider using the 'host' network mode for a Docker container?
Explanation:
The 'host' mode allows the container to directly access the host's network interfaces and observe all network traffic, making it suitable for network monitoring tools.
What is the core functionality of Docker?
Explanation:
Docker specializes in creating lightweight, portable environments called containers. These containers encapsulate applications and their dependencies, making them runnable on various systems without compatibility issues.
What is the primary purpose of Docker?
Explanation:
Docker's core function is to package applications and their dependencies into containers, creating consistent and isolated environments for development, testing, and deployment.
What is the primary purpose of Docker containers in software development?
Explanation:
Docker containers encapsulate applications and their dependencies, providing a consistent and isolated environment across different systems. This isolation and portability enhance development, testing, and deployment workflows.
Which command is used to download a Docker image from a registry?
Explanation:
The docker pull
command retrieves an image from a registry, such as Docker Hub, and stores it locally for later use in creating containers.
Which component of Docker's architecture is responsible for building and storing Docker images?
Explanation:
Docker Registries, like Docker Hub, act as repositories for Docker images. They allow developers to store and share pre-built images, simplifying application deployment.
Which file format does Docker Compose use for defining application services?
Explanation:
Docker Compose relies on a YAML file named 'docker-compose.yml' to describe the services, networks, and volumes that make up your application. YAML's human-readable format makes it well-suited for this purpose.
How do you list all running Docker containers?
Explanation:
The command 'docker ps' provides a list of all actively running containers on your system. The '-a' flag would show all containers, including stopped ones.
Which command is used to create and start a Docker container?
Explanation:
The docker run
command is a combined operation. It first creates a new container from a specified image and then starts that container.
What does the '-d' flag do when running a Docker container?
Explanation:
The -d
flag stands for 'detached.' It instructs Docker to run the container in the background, keeping your terminal session free.
In a 'docker-compose.yml' file, what is the keyword used to define a service?
Explanation:
The 'service' keyword is the fundamental building block in a 'docker-compose.yml' file. Each service you define represents a container or a set of containers that work together.
After stopping a container, you want to remove it completely. What command should you use?
Explanation:
docker rm
is used to remove a container. Note: The container must be stopped before it can be removed.