the concept is the same as Vagrant. but it's substantially faster. when you `fig up` your app, it spins up almost instantaneously because it's backed by Docker.
Similar ends, but different means. Vagrant would launch a full-blown VM (likely on the order of several minutes), whereas fig'ing will start a container (on the order of a few seconds).
The other comments at this level saying Vagrant spins up a full VM are incorrect. Vagrant will spin up boot2docker if it isn't running (which Fig requires as well), and then just execute Docker to run containers. On Linux, Vagrant doesn't spin up a VM at all; it just executes Docker directly.
I'm not here to talk about Fig vs. Vagrant, since I think this thread should be about congratulating Fig to 1.0, but I did want to make sure that some facts aren't incorrect.
Right, I really phrased that poorly. I use vagrant on a windows machine in the office and various macs at home. Without the LXC, fig & docker don't really provide anything above what I'm using. Were I to move to linux, then this would have some advantages. Thanks for the clarification and a fantastic product.
Fig is a tool written in Python specifically designed to orchestrate groups of docker containers. It does not require virtualization by default, it talks directly to the Docker API (so you can use it directly on Linux without boot2docker/VirtualBox). It is useful because previously people were writing their own custom little Bash scripts etc. to bootstrap containers for e.g. a PHP app to run app code, a MySQL database, a redis instance and an instance of nginx to serve static files which are all meant to be tied together and work together in a specific way. One of the goals of docker is "one concern per container" so this helps people to use it in the right way and you don't have to, say, restart your database to restart your app (like you would if you crammed them all into one container).
Vagrant is a general purpose tool for automation and management of virtual machines written in Ruby. You specify configuration in Ruby. One of its goals is choice, so it has swappable "drivers" (so that you can use different hypervisors such as VirtualBox, Fusion, and HyperV) and "provisioners" (for installing software etc. when you bootstrap a new VM). I'm afraid I have to plead ignorance on the Docker provisioner, but mitchellh is the creator so I'm sure his input is sound.
I don't know on what planet "Kubernetes" is an answer to "Who runs all containers on a single host". Because that's sure not what Kubernetes or Mesos do.
In fact, I'm amazed at the amount of businesses that don't. Half of what TechCrunch writes about is, in technical terms, Rails CRUD apps. Why would they need more than a single host in the first year?
fig generally gets used for development environments since it's relatively easy to install docker, install fig, clone a repo and run `fig up` and get that application running correctly with all of its dependencies including database, background workers, etc. No more of the old "ok, install postgres, install the right gems, etc. just to make some small change in this project" song and dance!
However, it's perfectly suited to run in production for small to medium sized applications. You can even see a sample "Deploy on git push using fig" that I put together here:
I'm not sure why Fig got so popular, when Crane [1] was on Go since day one, is actively developed, and pretty much does the same thing maybe even better. I haven't seen the latest Fig features though. Maybe Fig finally does more, but ideally they should merge especially when Fig is planning to migrate to Go!
Usually I just have a very tiny .dockerignore with .git in it (since .git usually grows so huge), although some applications store logs and stuff that you should probably not send to the docker daemon every time.
I've found Github's auto-generated-by-language .gitignore files very useful.
I think it's just a tiny wrapper that oh-my-zsh has, but I have a `gi` bash function that calls out to gitignore.io/api/$@. Then I just redirect the response to .gitignore.
Glad someone agrees with me :) For what it's worth, I resisted adding .dockerignore as long as I could, basically for the same reason (why not add .gitignore support instead?) but the demand for it was simply too overwhelming to ignore, so I gave up and let it in.
It links docker containers for local dev environments. You can launch a project with say a webapp, a cache like redis, and a db like mysql with the comamnd 'fig up'. The 3 docker containers in this case are linked via a fig.yml that defines the setup. It also attaches your local development code so realtime changes propgate through the cotainer (e.g live server reloads)
Getting a new dev onboarded with your whole dockerized stack involves:
- pip install fig
- cd into directory with fig.yml
-'fig up'
Really a great tool. Definitely recommend it. Good intro here: http://www.fig.sh/
36 comments
[ 3.9 ms ] story [ 77.7 ms ] threadSee linked page at https://docs.docker.com/installation/mac/
Note VirtualBox is one of the only modules blacklisted by the Linux kernel not for being proprietary (it's Open Source) but because it's terrible.
http://www.phoronix.com/scan.php?page=news_item&px=OTk5Mw
We agree that VBox is not ideal but it is free and we would like to have other options (Fusion, HyperV) available in the future as well.
For the sake of simplicity and distribution the OSX and Windows installers package boot2docker with Virtualbox.
The other comments at this level saying Vagrant spins up a full VM are incorrect. Vagrant will spin up boot2docker if it isn't running (which Fig requires as well), and then just execute Docker to run containers. On Linux, Vagrant doesn't spin up a VM at all; it just executes Docker directly.
I'm not here to talk about Fig vs. Vagrant, since I think this thread should be about congratulating Fig to 1.0, but I did want to make sure that some facts aren't incorrect.
Fig is a tool written in Python specifically designed to orchestrate groups of docker containers. It does not require virtualization by default, it talks directly to the Docker API (so you can use it directly on Linux without boot2docker/VirtualBox). It is useful because previously people were writing their own custom little Bash scripts etc. to bootstrap containers for e.g. a PHP app to run app code, a MySQL database, a redis instance and an instance of nginx to serve static files which are all meant to be tied together and work together in a specific way. One of the goals of docker is "one concern per container" so this helps people to use it in the right way and you don't have to, say, restart your database to restart your app (like you would if you crammed them all into one container).
Vagrant is a general purpose tool for automation and management of virtual machines written in Ruby. You specify configuration in Ruby. One of its goals is choice, so it has swappable "drivers" (so that you can use different hypervisors such as VirtualBox, Fusion, and HyperV) and "provisioners" (for installing software etc. when you bootstrap a new VM). I'm afraid I have to plead ignorance on the Docker provisioner, but mitchellh is the creator so I'm sure his input is sound.
In fact, I'm amazed at the amount of businesses that don't. Half of what TechCrunch writes about is, in technical terms, Rails CRUD apps. Why would they need more than a single host in the first year?
[1] https://github.com/centurylinklabs/fig2coreos
[2] http://www.centurylinklabs.com/building-complex-apps-for-doc...
However, it's perfectly suited to run in production for small to medium sized applications. You can even see a sample "Deploy on git push using fig" that I put together here:
https://github.com/nathanleclaire/laraveldocker
It's fun!
[1] https://github.com/michaelsauter/crane
Gosh dangit. It's about to the point I need a separate tool just to manage all my .ignore files.
Come to think of it, maybe just ln -s will do.
I've found Github's auto-generated-by-language .gitignore files very useful.
`gi vim,linux,node,grunt,bower > .gitignore`
Super handy.
See https://github.com/docker/docker/pull/3452 and follow -up mailing list thread.
In the end it kind of grows on you :)
Getting a new dev onboarded with your whole dockerized stack involves:
- pip install fig
- cd into directory with fig.yml
-'fig up'
Really a great tool. Definitely recommend it. Good intro here: http://www.fig.sh/