How to do Docker development?

workspace
docker

#1

To make environments consistent between dev, staging, and production I want to start moving towards using Docker for many of my projects.

I am aware that Cloud9’s default workspaces don’t support Docker. They are themselves running in a Docker container in non-privileged mode, so attempting to run Docker inside of one leads to a segmentation fault. However Cloud9 supports SSH workspaces, which can run Docker… But I run into one of two issues:

  1. All projects in one workspace: If I put all of my different websites, web apps, and other projects in a single workspace then it becomes difficult to manage, track, and even remember what projects I have. It’s easy to get wires crossed and I may attempt to make an update to one project but accidentally update another.
  2. All projects in their own workspace: If using an SSH workspace, this seems to imply that each workspace has its own VM. This causes costs to scale linearly with the number of projects. If spinning up a new project adds $10 per month to my hosting bill, I’m disincentivized to take on new work.

Is there an easy solution I’m missing? How am I supposed to do Docker-based development to ensure a consistent environment across all deployments of my app?


#2

SSH workspaces are run on computers that you own. You can also have more than one SSH workspace tied to a single host. These do not cost extra per workspace; the only additional cost would be for each individual machine you use as an SSH workspace.

Additionally, if you migrate to AWS Cloud9, you can use SSH environments for no additional cost, since these do not consume additional AWS resources (unless the host you choose to use is an EC2 instance, at which point you will be billed for any EC2 usage).


#3

FWIW, I believe that AWS Cloud9 runs on a VM instead of a container, and thus can run Docker natively.