vagrant、docker、virtualenv 或只是一个虚拟机有什么区别? [英] what is the difference between vagrant, docker, virtualenv or just a virtual machine?

查看:29
本文介绍了vagrant、docker、virtualenv 或只是一个虚拟机有什么区别?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用 python 和 django 框架开发网站,我喜欢快速完成工作.以前用虚拟机或者在本地主机,最近去了vagrant,不知道有没有其他技术可以帮助保持进程更快?我可以使用一些提示和指示.

I develop websites using python with django framework, I like to get things done fast. I used to use virtual machine or in the local host machine, recently went to vagrant, I am not sure if there is other technologies to help keep the process faster? I could use some tips and pointers.

推荐答案

- Docker

  • 非常擅长通过 Docker Index 构建和共享磁盘映像
  • Docker 是基础设施的管理器(今天的绑定是针对 Linux 容器的,但未来的绑定包括 KVM、Hyper-V、Xen 等)
  • Docker 是使用配置管理器(如 Chef、Puppet、SaltStack 等)构建的服务器模板的出色映像分发模型
  • Docker 使用 btrfs(写时复制文件系统)来跟踪文件系统差异,这些差异可以提交并与其他用户(如 git)协作
  • Docker 有一个磁盘映像(公共和私有)中央存储库,可让您轻松运行不同的操作系统(Ubuntu、Centos、Fedora,甚至 Gentoo)
    • 它在一台机器上隔离了 Python 解释器和 Python 依赖项,因此您可以安装多个 Python 项目并安装它们自己的依赖项.但是对于机器的其余部分,virtualenv 不做任何事情:

    • It isolates the Python interpreter and the Python dependencies on one machine so you can install multiple Python projects alongside each other with their own dependencies. But for the rest of the machine the virtualenv doesn't do anything:

    您仍然拥有使用 Mac OS X/Linux 包管理器安装的全局依赖项/包,并且这些在 virtualenv 之间共享.

    you still have global dependencies / packages that are installed using your Mac OS X / Linux package manager and these are shared between the virtualenvs.

    • 指定整机:它允许您指定Linux发行版、要安装的包以及安装项目要采取的操作.

    • specifies the whole machine: it allows you to specify the Linux distribution, packages to be installed and actions to be taken to install the project.

    因此,如果您想在该机器上启动带有多个 Python 项目的 Vagrant 框,您仍然需要使用 virtualenv 来保持 Python 依赖项的分离.

    So if you want to launch a Vagrant box with multiple Python projects on that machine you'd still use virtualenv to keep the Python dependencies separate.

    • 它是一种软件程序或操作系统,不仅表现出独立计算机的行为,而且还能够执行任务,例如像独立计算机一样运行应用程序和程序.
    • 通常称为来宾的虚拟机是在称为主机"的另一个计算环境中创建的.
    • 同一台主机中可以同时存在多个虚拟机.

    这篇关于vagrant、docker、virtualenv 或只是一个虚拟机有什么区别?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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