Docker Community Forums

Share and learn in the Docker community.

Is there a way to create new image from 2 connected images?


(G) #1

Folks,

A newbie question: Is it possible to create a new image from 2 connected images?
I have an application that uses a database and I want to be able to create an image that includes these 2 components together.

Thanks
G


(Jeff Anderson) #2

Docker does not provide any sort of tooling that will try to do the binary merging that would be required to somehow make two arbitrary filesystems work together as one.

Normally, you would just run two containers-- one using the Application Image, and one running the Database Image.

If for whatever reason you really need both components in one image, you would have to intentionally build that one image to have both those components included.


(G) #3

Thanks Jeff,

I am reading you text and I guess what I am looking for is a way to create a new image from 2 containers running together.

G


(Jeff Anderson) #4

What you are looking for is probably something like docker-compose. It allows you to define multiple containers that get deployed together.


(G) #5

Thanks Jeff, I will have a look at docker-compose.

Golan