I've been using Vagrant for some time and am now exploring Docker. I've always loved Vagrant for its simplicity. Right now, I'm trying to use the Docker provider within Vagrant. I'm using the following Vagrantfile:
Vagrant.configure("2") do |config|
config.vm.provider "docker" do |d|
d.image = "fgrehm/vagrant-ubuntu:precise"
end
end
My understanding is that I can just run vagrant up
. I can then run the Docker container using vagrant docker-run -- <command>
.
So far so good. What makes Docker so awesome is the fact that you can mess around and commit changes. I do not understand is how to incorporate this in my workflow when using the Docker provider for Vagrant. E.g. how do I run docker commit
to commit the state of the container? I'd expect some kind of vagrant docker-commit
, but this does not exist?
Edit: In hindsight, I think this is not the way you should be using Vagrant/Docker. Though it is claimed that both tools complement each other, my opinion is that they do not (yet) play really well together. Right now, we're using Dockerfiles to build our images. Additionally, we made a set of bash scripts to launch a container.