How to create a pod with a single container having multiple images


Can we have a single container with multiple image like nginx + Redis + alpine ? Is this possible? if yes, how to create it,. Any way interactive or yaml based ? please share the yaml file if possible


Hello, @ramizahmad746

Check this lecture:

And try this lab:

Thanks @KodeKloud I did practiced this but my question is what if I need to create a single container inside a pod with 3-4 images like nginx + Redis + alpine?
Is this possible? if yes, how to create it?

In simple words, that’s not possible in k8s’s Pod.
You can achieve this from Dockerfile.

Thanks @player001,if we create an image out of this Dockerfile and use that image to create a POD then I guess it will work,what do you think?

@ramizahmad746 yes it works but that is not multiple images, you use one image alpine and install nginx, redis via command.

Why would you like to do that?

How about creating it through Init Containers?