▶ MCQ Portal
Home
Medical
Neet-Ug
4
Ssc-Cgl
General_Awareness
5
Devops
Ansible
10
Aws
5
Azure
10
Docker
5
Jenkins
5
Kubernetes
5
Terraform
10
⚑ Feedback
Home
docker
Exam2
Exam2
devops / docker
• 5 questions
Question 1 of 5
Which Dockerfile instruction sets the base image for the build?
A.
BASE
B.
FROM
C.
START
D.
IMAGE
Question 2 of 5
What is the key difference between RUN and CMD in a Dockerfile?
A.
They are identical instructions
B.
RUN executes commands at build time; CMD provides the default command for the running container
C.
CMD executes at build time; RUN provides the default runtime command
D.
RUN is only for Linux; CMD works on all platforms
Question 3 of 5
What does the EXPOSE instruction do in a Dockerfile?
A.
Opens a port on the host machine automatically
B.
Documents which network port the container listens on at runtime
C.
Maps a host port to the container port
D.
Blocks all ports except the one specified
Question 4 of 5
What is the purpose of a .dockerignore file?
A.
To ignore specific Docker CLI commands
B.
To exclude files and directories from the build context sent to the Docker daemon
C.
To disable Docker networking for a container
D.
To ignore Docker Hub registry authentication
Question 5 of 5
What is the ENTRYPOINT instruction used for in a Dockerfile?
A.
Setting runtime environment variables
B.
Defining the executable that always runs when the container starts
C.
Copying files from the host into the image
D.
Exposing container ports to the host
← Back
Submit Answers ✓