Docker Community Forums

Share and learn in the Docker community.

Storing Data Images in a Registry


(Chrisevans) #1

I’m using compose to spin up developer environments made up of a number of containers. One of the containers is a database which contains data that is added during the docker build. This is all working pretty well and allows compose to pull everything it needs from the registry and setup a complete working environment with data already in it.

The problem I have is that the database image is getting large, and I’d like to be able to split the data from the the database software. I understand I could create a data container, add the data, and get my database image to use volumes from the data container, but is there a way to store everything in a registry to keep the environment setup simple?

I was thinking about creating a docker image which simply holds the data, and then using that to create a container with the data bound to volume. As I understand it, when the container is created it’ll copy the database data from the image into the volume and work as expected. Is there any downside to doing this?

Are there any other patterns which allow me to keep everything in the registry and achieve simple environment setup?