Need advice about which tool to choose?Ask the StackShare community!

Docker

174.8K
140.5K
+ 1
3.9K
Vagrant

11.5K
7.8K
+ 1
1.5K
Add tool

Docker vs Vagrant: What are the differences?

Docker is a containerization platform that enables you to package and run applications in isolated environments called containers. Vagrant is a tool for creating and managing virtual development environments, providing a consistent and reproducible setup for developers working on different machines. Here are some key differences between Docker and Vagrant:

  1. Virtualization vs Containerization: Vagrant is primarily a virtualization tool to create and manage lightweight, isolated virtual machines (VMs) for development and testing purposes. It uses providers like VirtualBox, VMware, or Hyper-V to create VMs and provisions them with the necessary software and configurations. Docker, on the other hand, is a containerization platform that allows for lightweight, isolated application packaging using containers. It provides a consistent runtime environment that encapsulates an application and its dependencies, making it portable and easily deployable.

  2. Development vs Production Focus: Vagrant is mainly designed for local development environments. It provides reproducible development environments that closely resemble production setups. Developers can define the desired state of a VM through a configuration file, and Vagrant automatically creates and provisions the VM accordingly. Docker, on the other hand, is designed for both development and production environments. It emphasizes creating containerized applications that can run consistently across different environments, from local development to production deployment.

  3. Complexity vs Simplicity: Vagrant offers more flexibility and control over VM configurations. This flexibility comes with a certain level of complexity, as managing VMs requires understanding the underlying virtualization technology and configuring the VM settings. Docker, in contrast, provides a simpler and more lightweight approach to application deployment using containers. It abstracts away much of the infrastructure complexity and offers standardized tools and workflows for building, distributing, and running containerized applications.

  4. Resource Utilization: Vagrant creates full-fledged VMs, which require more resources in terms of disk space and memory compared to Docker containers. VMs have their own operating system, kernel, and hardware virtualization overhead, which can make them heavier in terms of resource utilization. Docker containers, on the other hand, share the host operating system and kernel, resulting in lower resource overhead and faster startup times. This makes Docker more suitable for lightweight and scalable deployments, especially in cloud-native and microservices architectures.

In summary, Vagrant focuses on creating and managing virtual machines for development environments, providing flexibility and reproducibility. Docker, on the other hand, specializes in lightweight application containerization, making it easier to package, distribute, and deploy applications consistently across different environments, from development to production.

Decisions about Docker and Vagrant
Florian Sager
IT DevOp at Agitos GmbH · | 3 upvotes · 457K views
Chose
LXDLXD
over
DockerDocker

lxd/lxc and Docker aren't congruent so this comparison needs a more detailed look; but in short I can say: the lxd-integrated administration of storage including zfs with its snapshot capabilities as well as the system container (multi-process) approach of lxc vs. the limited single-process container approach of Docker is the main reason I chose lxd over Docker.

See more
Manage your open source components, licenses, and vulnerabilities
Learn More
Pros of Docker
Pros of Vagrant
  • 823
    Rapid integration and build up
  • 692
    Isolation
  • 521
    Open source
  • 505
    Testa­bil­i­ty and re­pro­ducibil­i­ty
  • 460
    Lightweight
  • 218
    Standardization
  • 185
    Scalable
  • 106
    Upgrading / down­grad­ing / ap­pli­ca­tion versions
  • 88
    Security
  • 85
    Private paas environments
  • 34
    Portability
  • 26
    Limit resource usage
  • 17
    Game changer
  • 16
    I love the way docker has changed virtualization
  • 14
    Fast
  • 12
    Concurrency
  • 8
    Docker's Compose tools
  • 6
    Easy setup
  • 6
    Fast and Portable
  • 5
    Because its fun
  • 4
    Makes shipping to production very simple
  • 3
    Highly useful
  • 3
    It's dope
  • 2
    Package the environment with the application
  • 2
    Super
  • 2
    Open source and highly configurable
  • 2
    Simplicity, isolation, resource effective
  • 2
    MacOS support FAKE
  • 2
    Its cool
  • 2
    Does a nice job hogging memory
  • 2
    Docker hub for the FTW
  • 2
    HIgh Throughput
  • 2
    Very easy to setup integrate and build
  • 0
    Asdfd
  • 352
    Development environments
  • 290
    Simple bootstraping
  • 237
    Free
  • 139
    Boxes
  • 130
    Provisioning
  • 84
    Portable
  • 81
    Synced folders
  • 69
    Reproducible
  • 51
    Ssh
  • 44
    Very flexible
  • 5
    Works well, can be replicated easily with other devs
  • 5
    Easy-to-share, easy-to-version dev configuration
  • 3
    Great
  • 3
    Just works
  • 2
    Quick way to get running
  • 1
    DRY - "Do Not Repeat Yourself"
  • 1
    Container Friendly
  • 1
    What is vagrant?
  • 1
    Good documentation

Sign up to add or upvote prosMake informed product decisions

Cons of Docker
Cons of Vagrant
  • 8
    New versions == broken features
  • 6
    Unreliable networking
  • 6
    Documentation not always in sync
  • 4
    Moves quickly
  • 3
    Not Secure
  • 2
    Can become v complex w prod. provisioner (Salt, etc.)
  • 2
    Multiple VMs quickly eat up disk space
  • 1
    Development environment that kills your battery

Sign up to add or upvote consMake informed product decisions

What is Docker?

The Docker Platform is the industry-leading container platform for continuous, high-velocity innovation, enabling organizations to seamlessly build and share any application — from legacy to what comes next — and securely run them anywhere

What is Vagrant?

Vagrant provides the framework and configuration format to create and manage complete portable development environments. These development environments can live on your computer or in the cloud, and are portable between Windows, Mac OS X, and Linux.

Need advice about which tool to choose?Ask the StackShare community!

What companies use Docker?
What companies use Vagrant?
Manage your open source components, licenses, and vulnerabilities
Learn More

Sign up to get full access to all the companiesMake informed product decisions

What tools integrate with Docker?
What tools integrate with Vagrant?

Sign up to get full access to all the tool integrationsMake informed product decisions

Blog Posts

PythonDockerKubernetes+7
3
1160
PythonDockerKubernetes+14
12
2657
Jul 9 2019 at 7:22PM

Blue Medora

DockerPostgreSQLNew Relic+8
11
2379
DockerAmazon EC2Scala+8
6
2762
GitHubDockerReact+17
41
37406
What are some alternatives to Docker and Vagrant?
LXC
LXC is a userspace interface for the Linux kernel containment features. Through a powerful API and simple tools, it lets Linux users easily create and manage system or application containers.
rkt
Rocket is a cli for running App Containers. The goal of rocket is to be composable, secure, and fast.
Kubernetes
Kubernetes is an open source orchestration system for Docker containers. It handles scheduling onto nodes in a compute cluster and actively manages workloads to ensure that their state matches the users declared intentions.
Cloud Foundry
Cloud Foundry is an open platform as a service (PaaS) that provides a choice of clouds, developer frameworks, and application services. Cloud Foundry makes it faster and easier to build, test, deploy, and scale applications.
Red Hat OpenShift
OpenShift is Red Hat's Cloud Computing Platform as a Service (PaaS) offering. OpenShift is an application platform in the cloud where application developers and teams can build, test, deploy, and run their applications.
See all alternatives