Docker Deep Dive: Dockerfile Demystified Quiz Quiz

  1. Dockerfile FROM Instruction

    Which instruction is used at the beginning of a Dockerfile to specify the base image?

    1. START
    2. BASE
    3. FROM
    4. BEGIN
    5. IMAGE
  2. WORKDIR Instruction

    What instruction is used to set the working directory inside the container?

    1. RUN_DIR
    2. WORKDIR
    3. SETDIR
    4. DIRECTORY
    5. CD
  3. COPY vs ADD

    Which instruction is best suited for copying local files and directories into the container image, and does not support remote URLs?

    1. IMPORT
    2. ADD
    3. COPY
    4. LINK
    5. INCLUDE
  4. RUN Instruction

    What instruction is used to execute commands inside the container during the image build process?

    1. EXECUTE
    2. COMMAND
    3. RUN
    4. DO
    5. CMD
  5. CMD vs ENTRYPOINT

    Which instruction defines the command to execute when the container starts, but can be overridden by command-line arguments?

    1. START
    2. RUN
    3. EXEC
    4. ENTRYPOINT
    5. CMD
  6. Exposing Ports

    What instruction is used to declare which ports the container will listen on at runtime?

    1. PUBLISH
    2. LISTEN
    3. PORT
    4. OPEN
    5. EXPOSE
  7. Setting Environment Variables

    Which instruction is used to set environment variables inside the container?

    1. SET
    2. VAR
    3. ENV
    4. DEFINE
    5. ENVIRONMENT
  8. User Instruction

    What instruction is used to specify the user to run subsequent commands as inside the container?

    1. SUDO
    2. USER
    3. AS_USER
    4. RUNAS
    5. OWNER
  9. Ignoring Files with .dockerignore

    What is the name of the file used to specify files and directories that should be excluded from the Docker build context?

    1. ignore.docker
    2. exclude.docker
    3. .dockerignore
    4. .dockerignorefile
    5. docker.exclude
  10. Understanding Layers

    Each instruction in a Dockerfile creates a new what?

    1. Volume
    2. Container
    3. Network
    4. Image Layer
    5. Process