What is the purpose of 'docker exec' command?
To list all available Docker images
To push a Docker image to a registry
To execute a command inside a running container
To build a Docker image from a Dockerfile
Which command is used to list all running Docker containers?
docker ps
docker start
docker images
docker run
What is a key benefit of using a private Docker Registry in a continuous integration/continuous deployment (CI/CD) pipeline?
It enables faster and more controlled image distribution within the pipeline.
It simplifies the process of building images from source code.
It eliminates the need for image version control.
It allows for easier public image discovery.
When might a bind mount be a suitable choice for data persistence in Docker?
When you need to share sensitive configuration files between the host and a container.
When you require data portability across different Docker environments.
When you want to leverage the scalability and redundancy of cloud storage.
When you need to share data between multiple Docker containers running on the same host.
What is the purpose of the ONBUILD instruction in a Dockerfile?
ONBUILD
To define commands that will be executed when the container starts.
To define commands that will be executed when a new image is built FROM the current image.
To specify environment variables that will be available at build time.
To specify the base image for the Dockerfile.
How does Docker contribute to improved security in CI/CD?
Docker's containerization provides isolation, limiting the impact of vulnerabilities
Docker automatically encrypts data at rest and in transit
Docker eliminates the need for security updates by isolating applications
Docker enforces strict access control policies on application code
What is the purpose of the 'docker push' command in the context of a Docker Registry?
Build a Docker image from a Dockerfile
Upload an image to a registry
Download an image from a registry
Run a Docker container from an image
What is the primary function of a Docker Registry?
Managing network traffic between containers
Building Docker images
Running Docker containers in production
Storing and distributing Docker images
How do you retrieve the IP address of a running Docker container using 'docker inspect'?
docker inspect <container_name> --format IP
docker inspect <container_name> | find 'IP'
docker inspect -f '{{.NetworkSettings.IPAddress}}' <container_name>
docker inspect <container_name> | grep IPAddress
In Docker Swarm, what is the function of the 'docker stack deploy' command?
To scale an existing service to a desired number of replicas
To define a new service with specific configurations
To deploy a complete application stack defined in a YAML file
To deploy a single container based on a Docker image