nerdexam
LPI

305-300 · Question #77

Which functionality is provided by Vagrant as well as by Docker? (Choose three.)

The correct answer is A. Both can share directories from the host file system to a guest. C. Both can download required base images. D. Both can apply changes to a base image. Both Vagrant and Docker can share directories from the host file system to a guest. This allows the guest to access files and folders from the host without copying them. Vagrant uses the config.vm.synced_folder option in the Vagrantfile to specify the shared folders. Docker…

Virtualization

Question

Which functionality is provided by Vagrant as well as by Docker? (Choose three.)

Options

  • ABoth can share directories from the host file system to a guest.
  • BBoth start system images as containers instead of virtual machines by default.
  • CBoth can download required base images.
  • DBoth can apply changes to a base image.
  • EBoth start system images as virtual machines instead of containers bv default.

How the community answered

(15 responses)
  • A
    80% (12)
  • B
    13% (2)
  • E
    7% (1)

Explanation

Both Vagrant and Docker can share directories from the host file system to a guest. This allows the guest to access files and folders from the host without copying them. Vagrant uses the config.vm.synced_folder option in the Vagrantfile to specify the shared folders. Docker uses the - v or --volume flag in the docker run command to mount a host directory as a data volume in the Both Vagrant and Docker can download required base images. Base images are the starting point for creating a guest environment. Vagrant uses the config.vm.box option in the Vagrantfile to specify the base image to use. Docker uses the FROM instruction in the Dockerfile to specify the base image to use. Both Vagrant and Docker can download base images from public repositories or local sources. Both Vagrant and Docker can apply changes to a base image. Changes are modifications or additions to the base image that customize the guest environment. Vagrant uses provisioners to run scripts or commands on the guest after it is booted. Docker uses instructions in the Dockerfile to execute commands on the base image and create a new image. Both Vagrant and Docker can save the changes to a new image or discard them after the guest is destroyed. Vagrant and Docker differ in how they start system images. Vagrant starts system images as virtual machines by default, using a provider such as VirtualBox, VMware, or Hyper-V. Docker starts system images as containers by default, using the native containerization functionality on macOS, Linux, and Windows. Containers are generally more lightweight and faster than virtual machines, but less secure and flexible.

Topics

#Vagrant#Docker#shared features#image management

Community Discussion

No community discussion yet for this question.

Full 305-300 Practice