Docker Community Forums

Share and learn in the Docker community.

Merging two docker container and launching it as one

(Ankitpateledu) #1

Hi All

I am just starting with Docker and containers. I am trying to optimize my use case. I have a container for Application ‘A’ which has specific OS and library requirements. I have another container for application ‘B’. B is a generic container with no specific OS requirement.

Now, I want to launch application A and B together in a same container. here one solution i see is to modify container A and add application B into it. and save it as a new image/container. But this solution can not scale for me. I will have many more containers like A in future.

is there an option too merge two containers (making sure A & B runs into same container.) into one when I launch it?

i read about docker files.
how/where do i locate docket files for images stored in my machine?

I am thinking if I can locate docker file for Application B; and Application A i can try to append docker file B after docker file A. for future use case i can write a shell script to append Application B in all containers i need to