Docker containers package an application with its environment. Why does this help avoid the common "it works on my machine" problem?
Think about how environment differences cause bugs.
Docker packages the app and its dependencies into a container that runs the same way everywhere, avoiding environment mismatch issues.
You run docker run -d --name myapp nginx to start a container. Then you run docker ps. What will you see?
Remember what docker ps shows.
docker ps lists running containers. Since you started 'myapp', it appears in the list.
Which workflow best explains how Docker speeds up testing during development?
Think about consistency and speed in testing.
Running tests inside Docker containers ensures the environment matches production, reducing errors and speeding up feedback.
You updated your app code but the Docker container still runs the old version. What is a likely cause?
Think about how Docker images and containers relate.
Docker containers run from images. If the image is not rebuilt after code changes, the container runs old code.
How should environment variables be handled in Docker to keep development and production environments secure and consistent?
Consider security and flexibility for different environments.
Using separate env files allows secure, flexible configuration without rebuilding images for each environment.