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

Bazel

301
569
+ 1
133
Docker

173.1K
139K
+ 1
3.9K
Add tool

Bazel vs Docker: What are the differences?

Introduction:

Bazel and Docker are both powerful tools used in software development and deployment. However, they have key differences in their functionalities and purposes. In this article, we will explore the differences between Bazel and Docker in detail.

  1. Build Process: Bazel is primarily a build automation tool that focuses on creating reproducible and efficient builds. It uses a build graph to determine the dependencies and parallelizes the build process. On the other hand, Docker is a platform that allows developers to package their applications and dependencies into portable containers.

  2. Isolation: Bazel provides isolation at a fine-grained level by implementing sandboxing techniques. It ensures that the build process does not have any external dependencies or side effects. Docker, on the other hand, provides a more heavyweight form of isolation by using containerization. It encapsulates an entire environment, including the application and its dependencies.

  3. Portability: Bazel is designed to be highly portable and platform-agnostic. It can build software for various platforms and architectures without any modifications to the build configuration. Docker, on the other hand, provides a consistent execution environment by abstracting away the underlying operating system and hardware, making it easier to run applications across different platforms.

  4. Reproducibility: Bazel emphasizes reproducibility by ensuring that the build process is hermetic and deterministic. It uses content hashing to verify that the build inputs are unchanged and produces the same outputs consistently. Docker focuses more on providing a consistent runtime environment, but it may not guarantee the exact same outputs for a given input in different environments.

  5. Dependency Management: Bazel has sophisticated dependency management capabilities built-in. It can resolve and fetch dependencies from various sources efficiently, allowing for incremental builds. Docker, on the other hand, relies on package managers and container registries to manage dependencies within containers.

  6. Resource Utilization: Bazel optimizes resource utilization by caching build artifacts and only rebuilding what is necessary. It can skip the build process for unchanged dependencies, resulting in faster build times. Docker, however, may require building the entire container from scratch whenever there is a change, leading to potentially longer build times.

In summary, Bazel focuses on efficient and reproducible builds with fine-grained isolation and dependency management, while Docker provides encapsulation of applications and their dependencies for easy deployment and portability.

Decisions about Bazel and Docker
Florian Sager
IT DevOp at Agitos GmbH · | 3 upvotes · 443.5K 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 Bazel
Pros of Docker
  • 28
    Fast
  • 20
    Deterministic incremental builds
  • 17
    Correct
  • 16
    Multi-language
  • 14
    Enforces declared inputs/outputs
  • 10
    High-level build language
  • 9
    Scalable
  • 5
    Multi-platform support
  • 5
    Sandboxing
  • 4
    Dependency management
  • 2
    Windows Support
  • 2
    Flexible
  • 1
    Android Studio integration
  • 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
    Fast and Portable
  • 6
    Easy setup
  • 5
    Because its fun
  • 4
    Makes shipping to production very simple
  • 3
    It's dope
  • 3
    Highly useful
  • 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
    HIgh Throughput
  • 2
    Very easy to setup integrate and build
  • 2
    Package the environment with the application
  • 2
    Super
  • 0
    Asdfd

Sign up to add or upvote prosMake informed product decisions

Cons of Bazel
Cons of Docker
  • 3
    No Windows Support
  • 2
    Bad IntelliJ support
  • 1
    Poor windows support for some languages
  • 1
    Constant breaking changes
  • 1
    Learning Curve
  • 1
    Lack of Documentation
  • 8
    New versions == broken features
  • 6
    Unreliable networking
  • 6
    Documentation not always in sync
  • 4
    Moves quickly
  • 3
    Not Secure

Sign up to add or upvote consMake informed product decisions

What is Bazel?

Bazel is a build tool that builds code quickly and reliably. It is used to build the majority of Google's software, and thus it has been designed to handle build problems present in Google's development environment.

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

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

What companies use Bazel?
What companies use Docker?
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 Bazel?
What tools integrate with Docker?

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

Blog Posts

Mar 24 2021 at 12:57PM

Pinterest

GitJenkinsKafka+7
5
2180
GitJenkinsGroovy+4
6
2741
PythonDockerKubernetes+7
5
1131
PythonDockerKubernetes+14
12
2632
Jul 9 2019 at 7:22PM

Blue Medora

DockerPostgreSQLNew Relic+8
11
2357
What are some alternatives to Bazel and Docker?
Pants
Pants is a build system for Java, Scala and Python. It works particularly well for a source code repository that contains many distinct projects.
Webpack
A bundler for javascript and friends. Packs many modules into a few bundled assets. Code Splitting allows to load parts for the application on demand. Through "loaders" modules can be CommonJs, AMD, ES6 modules, CSS, Images, JSON, Coffeescript, LESS, ... and your custom stuff.
Ansible
Ansible is an IT automation tool. It can configure systems, deploy software, and orchestrate more advanced IT tasks such as continuous deployments or zero downtime rolling updates. Ansible’s goals are foremost those of simplicity and maximum ease of use.
Buck
Buck encourages the creation of small, reusable modules consisting of code and resources, and supports a variety of languages on many platforms.
CMake
It is used to control the software compilation process using simple platform and compiler independent configuration files, and generate native makefiles and workspaces that can be used in the compiler environment of the user's choice.
See all alternatives