Development environment: Vagrant or Docker?

(Eric Carlson) #1

Continuing the discussion from Log of setting up Docker in Virtualbox:

What is the preferred development environment these days? I have Vagrant up and running as recommended in Discourse as Your First Rails App and Discourse Vagrant Developer Guide, but much of the recent discussion has been about Discourse Docker (which I freely admit I haven’t really looked at for lack of time).

For development purposes, should I carry on using Vagrant for the time being? Or should I be setting up a VM with Ubuntu and then installing Docker and Discourse Docker?

(As a related side issue, my current production environment was built by following the Discourse Install Guide. Would it be prudent to switch that over to Docker at some point as well? Meaning, is version 1.0 likely to recommend Docker instead of a raw installation? This question deserves a topic of its own in some other category, but it seems best to see what people have to say about development environments before launching a second, better-informed discussion about production environments.)

So, for development, Vagrant or Docker?

How can we make our Vagrant VM image smaller?
(Abhishek Gupta) #2

If you can get good performance with VM, then go for it, however if your pc lacks some good hardware, you are good as it is.

(Eric Carlson) #3

The question is not really whether or not to use a VM. It is whether the best choice for development within a VM is to use Vagrant or to use Docker. This appears to me to be something of an apples or oranges kind of question, which is why I thought it might be good for discussion.

Perhaps another way of asking this is, will Vagrant continue to be supported? Or is Docker, which works for both development and production, thought to be the way forward?

(Kane York) #4

Oh, no, it wouldn’t work at all for development. There’s no way (i.e. it’s a pain to do) of changing the actual files, and the server is running in production mode.

Development implies that you’re changing the files quickly.

(Eric Carlson) #5

Great, thanks! This was exactly the kind of answer I was looking for. I will stick with my current Vagrant setup in that case.

Docker setup for development
(Jeff Atwood) #6

Docker is not intended for development at this time. Docker is a production or close-to-production-like environment.

(Erick Guan) #7

Team doesn’t use Vagrant any more.

I’d like to use Docker to deploy. And manually set up environment for development, though postgresql is a little annoyed…

(Jeff Atwood) #8

Vagrant is for development, Docker is for production deployment, these are apples and oranges. Two very different things!

Install a Plugin
(Michael Brown) #9

I’d like to see a dev environment in Docker - running Linux on my laptop so having a Docker image would be handy.

(can’t use Virtualbox as I run KVM)

(Fábio Rehm) #10

Sorry to revive this old thread but for those willing to use docker as a dev environment, an easy way of setting things up is a project of mine called Devstep: devstep ::

There’s even a demo of the tool in action using Discourse on the home page :wink:


(Ilya Kuchaev) #11

Could some upgrade the vagrant box to the actual software? Ubuntu 14.04 is out for a months.

(Ilya Kuchaev) #12

And regarding the file changes.
Can we build a dev image and mount the local folder there?

(Erlend Sogge Heggen) #13

Times have changed :slight_smile:

I’m surprised to find no mention of Fig, the official (after being acquired) “Docker as a development environment” by Docker Inc. themselves.

They have an example for setting up a Rails app.

(Régis Hanol) #14

What @codinghorror was saying is that our docker image isn’t intended for development :wink:

Docker can of course be used for whatever you want.

(Erlend Sogge Heggen) #15

Aaah, I stand corrected then. Thanks for clearing that up.

(Pubudu Kodikara) #16

The question is, can Fig replace Vagrant?

(Zingbats) #17

Hey all,

This topic is pretty stale, but I’m wondering if anyone, perhaps someone on the discourse team has a development docker-compose.yml they could share. I’m trying to get this working on boot2docker and having problems.

Vagrant isn’t still a thing, is it?


Well, it had to happen sometime: These apples and oranges are finally converging.
The makers of Vagrant have released its successor, which is specifically designed to work with Docker:

I haven’t tried this out yet, but I just heard about it here The Changelog #180: Otto, Vagrant, and Automation with Mitchell Hashimoto | Changelog | News and podcasts for developers
and it sounds pretty cool.