Question: Lets say I have a container that is fully equipped to serve a Rails app with Passenger and Apache, and I have a vhost that routes to /var/www/app/public in my container. Since a container is supposed to be sort of like a process, what would I do when my Rails code changes? If the `app` was cloned with Git, and there are pending changes in the repo, how can the container `pull` in these changes automatically?

Answer: 
You have a choice on how you want to structure your container, depending on your deployment philosophy:

* **Minimal:** You install all your rails pre-reqs in the Docker file (RUN commands), but have the ENTRYPOINT be something like "`git pull && bundle install --deployment && rails run`". At container boot time it will get your latest code.
* **Snapshot:** Same as above, but have the ENTRYPOINT *also* be a RUN command. This way, the container has a pre-installed snapshot of the code, but it will still update when the container is booted. Sometimes this can speed up boot time (i.e. if most of the gems are already installed).
* **Container as Deployment:** Same as above, but change the ENTRYPOINT to be "`rails run`" only. This way, your container *is* your code. You'll have to make new containers every time you change rails (automation!). The advantage is that your container won't need to contact your code repo at all. The downside is that you have to always remember what the latest container is. (Tags can help) And right now, Docker doesn't have a good story on cleaning up old containers.
In this scenario, it sounds like you have built an [image](http://docs.docker.io/en/latest/terms/image/) and are now running this image in a [container](http://docs.docker.io/en/latest/terms/container/).

Using the image your running container originates from, you could add another build step to git pull your most up to date code. I'd consider this an incremental update as your building upon a preexisting image. I'd recommend tagging and pushing to your (assuming your using a private index) appropriately. The new image would be available to run.

Depending on the need, you could also rebuild the base image of your software. I'm assuming your using a [Dockerfile](http://docs.docker.io/en/latest/use/builder/) to build your original image which includes a git checkout of your software. You could then tag and push to your index for use appropriately.