305-300 practice question 2 of 15
Which functionality is provided by Vagrant as well as by Docker? (Choose three.)
Full set: 121 questionsVagrant and Docker share several core functionalities despite their different primary use cases (VMs vs. containers). Both tools can map a directory from the host operating system into the guest environment for file sharing; Vagrant uses "synced folders," while Docker uses "bind mounts." Both systems are built upon the concept of base images. Vagrant downloads "boxes" from Vagrant Cloud, and Docker pulls "images" from a registry like Docker Hub. Furthermore, both allow users to make modifications to a running instance (a VM or a container) and then save those changes as a new, reusable base image. Vagrant uses the vagrant package command, while Docker uses docker commit or, more commonly, a Dockerfile with docker build.
B. Vagrant's default providers, such as VirtualBox or Hyper-V, create full virtual machines. While a Docker provider exists, it is not the default behavior.
E. Docker is a containerization platform and does not create or manage virtual machines; it exclusively runs containers which share the host's kernel.
1. Directory Sharing (A):
HashiCorp Vagrant Documentation. (n.d.). Synced Folders - Basic Usage. Retrieved from https://developer.hashicorp.com/vagrant/docs/synced-folders/basicusage. (This page describes how config.vm.syncedfolder maps a host path to a guest path).
Docker Documentation. (n.d.). Bind mounts. Retrieved from https://docs.docker.com/storage/bind-mounts/. (This document explains using the --mount or -v flag to mount a host file or directory into a container).
2. Downloading Base Images (C):
HashiCorp Vagrant Documentation. (n.d.). Boxes - Base Boxes. Retrieved from https://developer.hashicorp.com/vagrant/docs/boxes/base. (Section "Finding More Boxes" explains that Vagrant downloads boxes from Vagrant Cloud).
Docker Documentation. (n.d.). docker pull. Retrieved from https://docs.docker.com/engine/reference/commandline/pull/. (This page details how Docker pulls images from a configured registry if not found locally).
3. Applying Changes to a Base Image (D):
HashiCorp Vagrant Documentation. (n.d.). Command: package. Retrieved from https://developer.hashicorp.com/vagrant/docs/cli/package. (This document describes packaging a Vagrant environment into a reusable box).
Docker Documentation. (n.d.). docker commit. Retrieved from https://docs.docker.com/engine/reference/commandline/commit/. (This page explains how to create a new image from a container's changes).
4. Vagrant vs. Docker Architecture (B, E):
Fox, A., & Patterson, D. (2016). CS 169: Software Engineering, Lecture 18: Virtual Machines, Containers, Cloud. UC Berkeley. Retrieved from https://inst.eecs.berkeley.edu/~cs169/fa16/lectures/18-vms-containers-cloud.pdf. (Slides 15-25 compare the architectures, highlighting Vagrant's use of Type-2 Hypervisors for VMs versus Docker's container model).
Keep practicing
Take the free 305-300 practice test
Ten exam-style questions with answers and explanations, plus the exam facts and study guides.
More questions
Other 305-300 practice questions
- Question 1Which of the following devices exist by default in an LXC container? (Choose three.)
- Question 3A clone of a previously used virtual machine should be created. All VM specific informati…
- Question 4Which of the following mechanisms are used by LXC and Docker to create containers? (Choos…
- Question 5Which of the following values are valid in the firmware attribute of a element in a libvi…
- Question 6After creating a new Docker network using the following command: docker network create --…
- Question 7Which of the following commands boots a QEMU virtual machine using hardware virtualizatio…
