'Can I have two containers in one ec2 instance for different purpose? [closed]

I wanted to have one ec2 instance with two containers. One for performing backend operations using java. Another one to launch the shell scripts which also needs persistence storage.

I guess this can be achieved through ecs. But am not very well versed in ecs and also worried about DevOps when ecs need to be configured. So it it possible to have both containers without help of container service like ecs.



Solution 1:[1]

The way you ask it sounds like you have a virtual machine on Amazon, and you manage your containers manually (as opposed to e.g. letting Kubernetes do the job).

This way a docker container is just a process on the machine. And of course a single machine can run many processes.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Hiran Chaudhuri