Docker Community Forums

Share and learn in the Docker community.

Where is a Ruby on Rails' data stored in a Docker container?

(Philip Rhoades) #1


I have been using Docker for a while for some of my small Ruby on Rails sites and recently I realised I didn’t understand how something could be working! I am looking at this diagram:

but I am still unsure what is going on.

The background is:

  • I have had a number of small Rails sites going for years.
  • A while ago I decided to “Dockerise” all of them
  • I created a Fedora + RoR image
  • From this image I created a container for each of my sites
  • I copied the appropriate Rails dir into /home in each case
  • I created a nginx conf file on the host machine for each container / site

Everything has been working for a while now but just recently when I was in a hurry to update one of the sites, I updated the info in the original Rails dir on the HOST machine instead of in the dir in /home of the docker container - but it still worked!

How could this be? The way I understand a container is that it is self contained isn’t it? I think somehow I must be making some sort of compensatory mistake or something?