Container Mastery: A Docker Quiz Quiz

  1. Image Layers

    Which characteristic best describes how Docker images are built?

    1. A. Monolithically, as a single file.
    2. B. In layers, where each layer represents a set of instructions.
    3. C. By combining multiple base operating systems at once.
    4. D. Randomly, based on the build server's configuration.
    5. E. As a compressed tarball of all application files.
  2. Container Isolation

    What operating system level feature does Docker use to provide container isolation?

    1. A. Virtual Machines
    2. B. Namespaces and Control Groups (cgroups)
    3. C. Java Virtual Machine (JVM)
    4. D. Kernel patching
    5. E. Hypervisors
  3. Docker Compose

    Which Docker Compose command starts all services defined in a `docker-compose.yml` file?

    1. A. docker-compose run
    2. B. docker-compose start
    3. C. docker-compose up
    4. D. docker-compose build
    5. E. docker-compose create
  4. Image Size Optimization

    Which practice is most effective for reducing Docker image size?

    1. A. Using larger base images.
    2. B. Installing unnecessary packages.
    3. C. Combining multiple RUN instructions into one.
    4. D. Caching package manager indexes agressively
    5. E. Saving build artifacts directly into the image.
  5. Container Networking

    What is the default networking mode for containers created by Docker?

    1. A. Host
    2. B. None
    3. C. Bridge
    4. D. Overlay
    5. E. Macvlan
  6. Dockerfile FROM Instruction

    What is the purpose of the `FROM` instruction in a Dockerfile?

    1. A. Specifies the username and password for accessing the image.
    2. B. Defines the working directory for the container.
    3. C. Specifies the base image for the container.
    4. D. Defines the exposed port of the container.
    5. E. Copies files from the host to the container
  7. Docker Volumes

    What is the primary benefit of using Docker volumes?

    1. A. To increase container CPU performance.
    2. B. To store persistent data outside of the container's lifecycle.
    3. C. To isolate container processes from the host operating system.
    4. D. To compress image size
    5. E. To prevent containers from using network resources.
  8. Docker Hub

    What is the main purpose of Docker Hub?

    1. A. A container runtime environment
    2. B. A cloud-based container registry service
    3. C. A tool for building container images
    4. D. A software for orchestration containers
    5. E. A network proxy for container communication
  9. Security Best Practices

    Which of the following is a Docker security best practice?

    1. A. Running containers as the root user.
    2. B. Exposing all container ports to the internet.
    3. C. Regularly updating base images with security patches.
    4. D. Disabling container resource limits.
    5. E. Storing sensitive information directly in the Dockerfile.
  10. Docker Compose Scaling

    Which Docker Compose command is used to scale the number of instances of a service?

    1. A. docker-compose scale
    2. B. docker-compose replicas
    3. C. docker-compose instances
    4. D. docker-compose up --scale
    5. E. docker-compose expand