All Templates

Docker Fundamentals

Learn Docker basics with questions on images, containers, Dockerfiles, volumes, networking, and multi-stage builds. Perfect for developers getting started with containerization.

EASY7 questions10 minDevOps

Question Preview

1.What is the difference between a Docker image and a Docker container?
An image is a read-only template; a container is a running instance of an image
An image is a running process; a container is a stored file
They are the same thing with different names
A container is for development; an image is for production
EASYMultiple Choice
2.Which Dockerfile instruction sets the command that runs when a container starts?
CMD
RUN
COPY
EXPOSE
EASYMultiple Choice
3.What is the difference between CMD and ENTRYPOINT in a Dockerfile?
ENTRYPOINT sets the main executable; CMD provides default arguments that can be overridden at runtime
CMD runs during build time; ENTRYPOINT runs at container start
They are identical and interchangeable
ENTRYPOINT is deprecated in favor of CMD
MEDIUMMultiple Choice

+ 4 more questions included in the full template