DEV Community

Cover image for Lessons Learned with Docker

Lessons Learned with Docker

Alex Hanson on April 21, 2017

I've been working with Docker on a semi-regular basis for a couple months now. I am the technical lead for a product that not only has the usual de...
Collapse
 
andrewdtanner profile image
Andrew Tanner 🇪🇺

I'm a Vagrant user and have toyed with the idea of Docker but very much feel like it might be a sledgehammer to a nail for personal projects. Vagrant is quite heavy and I did cause myself a headache by not using an LTS Ubuntu distro so had to rebuild my box.

Question is, is there much benefit to using Docker for very small scale, personal projects? It seems better suited to scale. I'd be happy to learn just so I can learn something new but that might be as far as it goes.

Collapse
 
gegere profile image
#JASON

There is definitely a benefit for using Docker over Vagrant. Vagrant is a resource hog and takes a long time to deploy as it is near a full distro.

Docker is great for personal projects, small dev projects, and large scale projects.

I'm not sure what coding language you are using but I have a robust docker container repo for review here: github.com/htmlgraphic/Apache

In just a few commands you can have a duplicate setup with very small resource footprint when compared to Vagrant.

Collapse
 
aptituz profile image
Patrick Schönfeld

On top of that, I have to say that docker-compose even further increases the benefit of docker over vagrant, because it makes it very easy to share a whole environment that depends on other services (e.g. mysql, LDAP or whatever).

Collapse
 
rosshettel profile image
Ross Hettel

Instead of a ruby script wrapped around docker compose, wouldn't a docker compose environment file work the same? docs.docker.com/compose/environmen...

Collapse
 
ahansondev profile image
Alex Hanson

I can't remember specifically why, but I thought there was a reason the environment variables alone weren't enough for our environment. We do have separate environment files, and our developers can have a "local.yml" file that doesn't get checked in with local-specific configuration; that "local.yml" gets combined with the others to create the new compose file.

But, I think you're right, leveraging environment variables would probably accomplish the same goal. The separate script does provide the nice feedback of just saying "./application up" (for the name of the script) and the application starts, and makes it easy for non-members of the development team (who are often not familiar with Docker) to know what's going on.

Collapse
 
krichardson profile image
Kris Richardson

Docker compose also provides a way to extend a base compose file: docs.docker.com/compose/extends/

Collapse
 
arun4d profile image
Arun4D

You can try fabric8. This can solve lot of time. I have just tried for pre-dev environment.