Docker for Developers Educative Quiz Answers

Get Docker for Developers Educative Quiz Answers

By now, you’ve probably heard the buzz around Docker. It’s fundamentally changed the development process and been adopted by software teams of all sizes, and for good reason: Docker makes it considerably easier to create, deploy, and run applications with the use of containers.

Docker is here to stay, and is becoming one of the most in-demand technologies on the market. Mastering it now will help you produce better software, level up your career, and stand out from the crowd. Get started today.

Enroll on Educative

Quiz 1: Why Docker?

Q1. Which of the following is not a goal of the Ops team in DevOps?

  • Stability of production apps
  • Frequent deployments and updates
  • Manage Infrastructure
  • All othe the above
  • None of the above

Q2. How do Docker containers help solve dependency conflicts between applications?

  • Each application is running inside its own container with its own dependencies
  • Enforces you to upgrade all the applications affected by dependency upgrades
  • Reduces the time required to manage dependencies by grouping similiar applications on the same server
  • All of the above
  • None of the above

Q3. How do Docker containers allow scaling up when a single server isn’t enough to run an application?

  • Place a reverse proxy infront of the server
  • Duplicate the server as many times as required
  • Run as many containers as are required
  • All of the above
  • None of the above

Quiz 2: Basic Concepts

Q1. What is the role of a container in Docker?

  • A container is a virtual machine for Docker
  • A container is what Docker hosts
  • A container is used to contain Docker images
  • All of the above
  • None of the above

Q2. A Docker container is isolated from other containers.

  • True
  • False

Q3. What is the purpose of an image in Docker?

  • An image is used to create registries
  • An image is what Docker hosts
  • An image is a template used for creating Docker containers
  • All of the above
  • None of the above

Q4. A single image can only create a single container.

  • True
  • False

Q5. What is the role of a registry in Docker?

  • Stores all the Docker containers
  • Is used to create a Docker container
  • Stores the Docker containers which are created from the same image
  • All of the above
  • None of the above

Quiz 3: Use Docker Images

Q1. What happens when we try to create a container using an image that isn’t present on our disk?

  • We get an error that image is not found
  • Docker downloads it from a default registry
  • Docker uses an image that is present on our disk
  • All of the above
  • None of the above

Q2. What does the following command do?

docker run hello-world
  • Asks Docker to create and run a container based on the hello-world image
  • Asks Docker to run the hello-world image
  • Asks Docker to run the hello-world container
  • All of the above
  • None of the above

Q3. Which command gets detailed information about a specified container regardless of if it is running or stopped?

  • docker ps
  • docker ps -a
  • docker logs
  • docker inspect
  • docker stop
  • docker rm
  • None of the above

Q4. Which command deletes a specified container?

  • docker ps
  • docker ps -a
  • docker logs
  • docker inspect
  • docker stop
  • docker rm
  • None of the above

Q5. Which command lists the containers which have stopped?

  • docker ps
  • docker ps -a
  • docker logs
  • docker inspect
  • docker stop
  • docker rm
  • None of the above

Q6. What does the following command do?

docker container prune -f
  • Deletes all the containers which are not in use, but prompts for confirmation before doing so
  • Deletes all containers regardless of if they are in use or not
  • Deletes all the containers which are not in use without prompting for confirmation
  • All of the above
  • None of the above

Q7. Which switch do we use with the docker run command to disconnect a long-lived container from the command-line?

  • -d
  • -f
  • -c
  • All of the above
  • None of the above

Q8. Which of the following commands will I use to state that I want my machine to listen for incoming connections on port 8085 and route them to port 80 inside a container that runs NGINX?

  • docker run -d 8085:80 nginx
  • docker run -p 80:8085 nginx
  • docker run -d -p 8085:80 nginx
  • All of the above
  • None of the above

Q9. What are volumes used for in Docker?

  • Map a directory inside a specified container to a persistent storage
  • They are used to avoid data loss
  • Ensure that any data written to the database directory inside a specified container is actually written to a directory on the host system
  • All of the above
  • None of the above

Q10. The docker run command first looks for an image locally. Which command forces an image to be downloaded from Docker Hub regardless of if it is already present on your local disk or not?

  • docker download
  • docker pull
  • docker registry
  • All of the above
  • None of the above

Q11. Each container is like a new machine regardless of if it’s made using the same image or not.

  • True
  • False

Quiz 4: Create Docker Images

Q1. What are the two main components required to create a Docker image?

  • docker build command & FROM instruction
  • docker build command & Dockerfile file
  • Dockerfile file & FROM instruction
  • All of the above
  • None of the above

Q2. Which instruction does a Dockerfile begin with?

  • FROM
  • VOLUME
  • CMD
  • ENV
  • COPY
  • None of the above

Q3. What is the purpose of a the FROM instruction in a Dockerfile?

  • Specifies from which registry the image is being created
  • Specifies which base image the current image is based on
  • Specifies from which image a container will be built
  • All of the above
  • None of the above

Q4. Naming an image is a requirement for creating it.

  • True
  • False

Q5. Which is the correct command to be used when creating an image from a Dockerfile?

  • Option 1
docker build -t hello
  • Option 2
docker build -f hello .
  • Option 3
docker build -t hello .
  • Option 4
docker build -f hello
  • None of the above

Q6. Which instruction can be used to insert additional files inside a Dockerfile?

  • FROM
  • VOLUME
  • CMD
  • ENV
  • COPY
  • None of the above

Q7. We have a Dockerfile that has From: ubuntu:latest. We build an image using this Dockerfile on November 3, 2021. We launch a container using the resulting image on February 23, 2022. Which base image for ubuntu will be used?

  • Latest as of November 3, 2021
  • Latest as of February 23, 2022
  • Any of the above
  • None of the above

Q8. The COPY instruction has two parameters. What are they?

  • First Parameter: Destination directory inside the image & Second Parameter: File to be copied from the build context
  • First Parameter: File to be copied from the build context & Second Parameter: Destination directory on disk
  • First Parameter: Directory from which file is to be copied & Second Parameter: Destination directory inside the image
  • First Parameter: File to be copied from the build context & Second Parameter: Destination directory inside the image
  • None of the above

Q9. Which switch allows you to stop a container using ctrl-c from the command line?

  • -rm
  • rmi
  • -it
  • ls
  • None of the above

Q10. What does the following command do?

docker image ls
  • Gives a list of containers built using the specified image
  • Deletes all images locally available on your computer
  • Gives a list of images locally available on your computer
  • All of the above
  • None of th above

Q11. Which instruction is used to define a default value for an environment variable in a Dockerfile?

  • EXPOSE
  • VOLUME
  • CMD
  • ENV
  • COPY
  • None of the above

Q12. Which instruction lets you store data in a persistent file system?

  • EXPOSE
  • VOLUME
  • CMD
  • ENV
  • COPY
  • None of the above

Quiz 5: Publish Docker Images

Q1. Which of the following functions are not offered by Docker Registry?

  • Ability to store various images
  • Ability to store various tags for the same image
  • Ability to store various containers
  • TLS-secured connection to the API in order to avoid man-in-the-middle attacks
  • All of the above
  • None of the above

Q2. What is the difference between a public and private registry?

  • A private registry ensures that only you can access your private images, while a public registry allows everyone to access your images
  • A private registry allows you to pick and choose who would have access to your private images while a public registry gives allows everyone to access your private images
  • A private registry ensures that only you can access your private images, while a public registry allows you to make your private images public for selective parties
  • All of the above
  • None of the above

Q3. Which of the following is true when you reduce the size of an image?

  • Reduce pull and push times
  • Use a minimum amount of space in the Registry
  • Use a minimum amount of space on the machines that will run the containers
  • Use a minimum amount of space on the machine that creates the image
  • All of the above
  • None of the above

Q4. Which list of factors influences the size of an image?

  • Base image version
    • Number of files in your image
    • Image layers
  • Base image size
    • Number of files in your image
    • Image layers
  • Base image size
    • Types of files in your image
    • Image layers
  • All of the above
  • None of the above

Q5. Why is it that when we rebuild an image, it takes a lesser amount of time as compared to the first time we built it?

  • It does not take a lesser amount of time to rebuild an image
  • If it takes a lesser amount of time to rebuild an image it means that it has not been built correctly
  • Because of the image layers which are cached during the initial build (after each instruction the partial image is cached creating image layers)
  • All of the above
  • None of the above
Conclusion:

I hope this Docker for Developers Educative Quiz Answers would be useful for you to learn something new from this problem. If it helped you then don’t forget to bookmark our site for more Coding Solutions.

This Problem is intended for audiences of all experiences who are interested in learning about Data Science in a business context; there are no prerequisites.

Keep Learning!

More Coding Solutions >>

LeetCode Solutions

Hacker Rank Solutions

CodeChef Solutions

Leave a Reply

Your email address will not be published.