Which of the following best explains why Docker containers are important in CI/CD pipelines?
Think about how Docker helps avoid "it works on my machine" problems.
Docker containers package the application and its environment together, so the app behaves the same everywhere. This consistency is key in CI/CD pipelines.
What will be the output of this Docker build command in a CI pipeline?
docker build -t myapp:latest .Consider what happens when a Dockerfile is present and the build succeeds.
The command builds a Docker image and tags it. The output confirms the image was built and tagged successfully.
In a CI workflow, what is the main role of Docker when running automated tests?
Think about how Docker helps avoid environment differences affecting test results.
Docker containers isolate tests from the host system, ensuring tests run the same way everywhere, which improves reliability.
During continuous deployment, the application runs an old Docker image version despite a new image being built. What is the most likely cause?
Check which image tag the deployment uses.
If the deployment script pulls an old tag, it will run the old image even if a new one exists. Updating the tag reference fixes this.
Which Docker image versioning strategy is best for CI/CD pipelines to ensure traceability and rollback capability?
Consider how to identify and rollback to specific image versions easily.
Using unique tags like build numbers or commit hashes allows precise identification of images, while 'latest' helps quick testing. This supports traceability and rollback.