码头工人vs流浪汉 [英] Docker vs Vagrant

查看:93
本文介绍了码头工人vs流浪汉的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

据我了解,每个Docker映像都基于基本映像-例如Ubuntu.

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

如果我想隔离任何进程,我应该部署ubuntu docker基础映像(此处与Vagrant有何不同?),并在将其安装到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?

因此,如果在Vagrant和Docker上启动Ubuntu,那么实践的区别在哪里?如果要在Vagrant中使用docker provider-Vagrant和Docker之间的区别在哪里?

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?

而且,在Docker中是否可以在没有基础映像的情况下隔离某些PC上的进程,而无需将其共享给另一台PC?

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

推荐答案

Vagrant是一个实用程序,可帮助您自动设置VM.Docker是一个实用程序,可帮助您在Linux中使用容器化.

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.

VM和Docker映像都可以是Ubuntu 14.04,但是使用Docker映像,您无需运行整个操作系统.

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.

例如,如果我想运行基于ubuntu的Nginx容器,我最终只会运行nginx进程.不需要upstart/systemd/init.VM将运行一个初始化系统,管理其自己的网络并运行其他服务.使用Linux发行版基础的容器映像方法主要是为了方便.

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.

完全有可能以最少的镜像运行Docker容器.运行容器只需要图像中一个静态编译的二进制文件即可.

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.

这篇关于码头工人vs流浪汉的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆