Docker vs Vagrant

Deadly 提交于 2021-02-05 06:09:47

问题


Every Docker image, as I understand, is based on base image - for example, Ubuntu.

And if I want to isolate any process I should deploy ubuntu docker base image (where is difference with Vagrant here?), and create a necessary subimage after it installing on ubuntu image?

So, if Ubuntu is launched on Vagrant and on Docker, where is practice difference? And if to use docker provider in Vagrant - where here is difference between Vagrant and Docker?

And, in Docker is it possible to isolate processes on some PC without base image without it's sharing to another PC?


回答1:


Vagrant is a utility to help you automate setting up VMs. Docker is a utility that helps you use containerization in linux.

A virtual machine runs a whole system, and emulates hardware. Containers section off processes in a single running kernel without emulating hardware.

Both a VM and a Docker image may be Ubuntu 14.04, but with the Docker image you don't need to run the whole OS.

For example, if I want to run an nginx container based on ubuntu, I'd end up with only the nginx process running. No upstart/systemd/init is needed. A VM would run an init system, manage its own networking, and run other services as well. The container image approach that uses a linux distro base is mostly for convenience.

It is entirely possible to run Docker containers with very minimal images. A statically compiled binary alone in an image is all you'd need to run a container.




回答2:


Vagrant : Vagrant is a project that helps the spawning of virtual machines. It started as an command line of VirtualBox, something similar to Gemfile for VM's. You can choose the base image to start with, network, IP, share folders and put it all in a file that anyone can reuse to spawn the same configured machine. Vagrant has different extensions, provisioning options and VM providers. You can run a VirtualBox, VMware and it is extensible enough to be able to create instances on EC2.

Docker : Docker, allows to package an application with all of its dependencies into a standardized unit of software development. So, it reduces a friction between developer, QA and testing. It dynamically change your application, adding new capabilities every single day, scaling out services to quickly changing the problem areas. Docker is putting itself in an excited place as the interface to PaaS be it networking, discovery and service discovery with applications not having to care about underlying infrastructure. Yes, their are still issues with docker in production, but, hopefully, we'll see the solutions to those problems, as docker team and contributors working hard on those issues. As Docker Volume driver allows third-party container data management solutions to provide data volumes for containers which operate on data, such as database, key-value stores, and other stateful applications. The latest version is coming with much more flexibility, complete orchestration build-in, advanced networking, secrets management, etc. As you can see one, rexray, as volume plugin and provides advanced storage functionality. emccode/rexray We're finally starting to agree on more than just images and run time.



来源:https://stackoverflow.com/questions/30401448/docker-vs-vagrant

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!