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

Docker

170.4K
137K
+ 1
3.9K
Packer

582
561
+ 1
42
Add tool

Docker vs Packer: What are the differences?

Introduction

Docker and Packer are both popular tools used in software development and deployment, but they serve different purposes and have distinct features. In this article, we will explore the key differences between Docker and Packer.

  1. Architecture and Purpose: Docker is a containerization platform that allows developers to package their applications and their dependencies into lightweight, portable containers. These containers can be run on any operating system with Docker installed, providing a consistent runtime environment. On the other hand, Packer is an open-source tool for creating machine images across multiple platforms. It allows you to automate the process of building images for different virtualization providers like Amazon EC2, Google Compute Engine, and more.

  2. Build Process: In Docker, the build process involves creating a Dockerfile, which is a text file that contains a set of instructions for building a Docker image. These instructions define the base image, dependencies, environment variables, and other configurations needed for the application. Packer, on the other hand, uses a JSON template to define the build process. This template specifies the builders (e.g., AWS, Azure, VirtualBox) and the source image, along with any provisioning steps required.

  3. Image Types: Docker builds and runs application containers, which are lightweight and efficient. These containers are isolated from the host system and can be easily deployed and scaled. Packer, on the other hand, builds machine images that can be used to create new instances (e.g., virtual machines) on various platforms. These images are typically larger and contain the entire operating system, software dependencies, and configurations.

  4. Orchestration: Docker provides built-in orchestration capabilities through Docker Swarm or Kubernetes, allowing you to manage and scale containers across multiple machines. It also offers a centralized container registry (Docker Hub) for sharing and distributing Docker images. Packer, on the other hand, focuses on the creation of machine images and does not provide built-in orchestration. However, you can integrate Packer with other orchestration tools like Terraform or Ansible to automate the deployment and management of infrastructure.

  5. Use Cases: Docker is widely used in applications that require fast, consistent, and isolated deployments, such as microservices architectures or containerized development environments. It is commonly used in DevOps environments for continuous integration and continuous deployment (CI/CD). Packer, on the other hand, is primarily used for infrastructure automation and image creation. It is useful for provisioning new instances in cloud environments or creating virtual machines for development and testing.

  6. Security and Isolation: Docker provides built-in security features like container isolation, resource limitations, and user namespaces to protect the host system and other containers. It also allows you to use custom security profiles and policies. Packer, on the other hand, focuses on creating images and does not provide built-in isolation features. However, you can use configuration management tools like Chef or Puppet in combination with Packer to apply security configurations and harden the machine images.

In summary, Docker and Packer are both powerful tools for software development and infrastructure automation. Docker is primarily focused on containerization and running applications, while Packer is specialized in image creation for various platforms. While Docker is commonly used for lightweight deployments, Packer is more suited for infrastructure automation and provisioning new instances.

Decisions about Docker and Packer
Florian Sager
IT DevOp at Agitos GmbH · | 3 upvotes · 415.4K 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
Get Advice from developers at your company using StackShare Enterprise. Sign up for StackShare Enterprise.
Learn More
Pros of Docker
Pros of Packer
  • 823
    Rapid integration and build up
  • 691
    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
    Very easy to setup integrate and build
  • 2
    HIgh Throughput
  • 2
    Package the environment with the application
  • 2
    Does a nice job hogging memory
  • 2
    Open source and highly configurable
  • 2
    Simplicity, isolation, resource effective
  • 2
    MacOS support FAKE
  • 2
    Its cool
  • 2
    Docker hub for the FTW
  • 2
    Super
  • 0
    Asdfd
  • 27
    Cross platform builds
  • 9
    Vm creation automation
  • 4
    Bake in security
  • 1
    Good documentation
  • 1
    Easy to use

Sign up to add or upvote prosMake informed product decisions

Cons of Docker
Cons of Packer
  • 8
    New versions == broken features
  • 6
    Unreliable networking
  • 6
    Documentation not always in sync
  • 4
    Moves quickly
  • 3
    Not Secure
    Be the first to leave a con

    Sign up to add or upvote consMake informed product decisions

    What companies use Docker?
    What companies use Packer?
    See which teams inside your own company are using Docker or Packer.
    Sign up for StackShare EnterpriseLearn More

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

    What tools integrate with Docker?
    What tools integrate with Packer?

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

    What are some alternatives to Docker and Packer?
    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.
    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.
    See all alternatives