Why Use Docker for Rails?
Learn how Docker saves repeated effort by providing a standardized environment that avoids many forms of the “works on my machine” issues.
We'll cover the following
What is Docker?
Docker is a set of tools built around the idea of packaging and running software in small, sandboxed environments known as containers.
Five capabilities of Docker
At a high level, Docker offers the following five features:
-
Packaging: The ability to package software into a reusable, shareable format known as images.
-
Distribution: The ability to easily share packaged software (images) with other people and deploy it to different machines.
-
Runtime: The ability to run, pause, restart or stop packaged software in a reliable, repeatable way.
-
Infrastructure creation: Creating virtual machines ready to run Docker containers.
-
Orchestration and scaling: Managing the release of software to a single Docker node or across an entire cluster.
Together, these five features combine to enable a new way of delivering and running software.
Benefits of using Docker
The benefits of using Docker for your development environment include:
- Docker’s built-in delivery mechanism installs software dependencies in one line.
-
Docker allows simulating production scenarios by running your app in multi-node, production-like environments on your local machine.
-
Technologies as part of our Rails apps – NGINX, Redis, Postgres, MySQL, Memcached, Elasticsearch, HAProxy, RabbitMQ, Node, etc., are already packaged and ready to go with Docker.
-
Docker can be used to add multiple technologies (like NGINX, Redis, Postgres, MySQL, Memcached, Elasticsearch, HAProxy, RabbitMQ, Node, etc.) that might be needed in a Rails app development.
-
Docker is reliable and resilient. Even if an instance dies, new copies of your app will be spawned on the remaining nodes.
-
Docker containers are much lighter-weight than virtual machines (VMs), allowing resources to be used more efficiently.