...

/

Setting Up Docker for Local Development

Setting Up Docker for Local Development

Learn how to configure the local environment to run Rails on a Docker container in your system.

All the code written in this course and all commands executed are run inside a Docker container. Docker provides a virtual machine of sorts and allows you to replicate, almost exactly, the environment in which we wrote the code (see Why Docker?WhyDocker). If you don’t know anything about Docker, that’s ok. You should learn what you need to know here.

Docker is traditionally used for deploying applications and services to a production environment like AWS, but it can also be used for local development. You’ll need to install Docker, after which we’ll create a series of configuration files that will set up your local Docker container where all the rest of the coding in this course will take place.

Installing Docker

While the main point of Docker is to create a consistent place for us to work, it does require installing it on whatever computer you are using, and that is highly dependent on what that computer is!

Rather than try to capture the specific instructions now, you should head to the Docker Desktop page, which should walk you through how to download, install, and run Docker on your computer.

What is Docker?

You can think of Docker as a tool to build and run virtual machines. It’s not exactly that, but the mental model is close enough. There are some terms with Docker that are confusing, but they are critical to understand, especially if you experience problems and need help.

  • Image: A Docker image can be thought of as the computer you might boot. It’s akin to a disk image, and is the set of bytes that has everything you need to run a virtual computer. An image can be started or run with docker start or
...