# One container spawns another container

**URL:** <https://forums.docker.com/t/one-container-spawns-another-container/91447>\
**Category:** General\
**Created:** [March 30, 2020, 1:26pm UTC](https://forums.docker.com/t/one-container-spawns-another-container/91447 "2020-03-30T13:26:29Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![hambone](https://avatars.discourse-cdn.com/v4/letter/h/58f4c7/32.png) [@hambone](https://forums.docker.com/u/hambone)\
**Post date:** [March 30, 2020, 1:26pm UTC](https://forums.docker.com/t/one-container-spawns-another-container/91447/1 "2020-03-30T13:26:29Z")

</div>

I have a container (I will call it parent) that launches a cpu intensive java [Process](https://docs.oracle.com/javase/8/docs/api/java/lang/Process.html) when a REST endpoint is triggered. I have been asked to use [docker-java](https://github.com/docker-java/docker-java) in the parent container to launch the Process in a new container.

Is this the right way to approach this problem?

I have read several blogs that suggest spawning a container from within another container is bad design, opens security issues and generally frowned upon. I am unable to find a conclusive answer to how this kind of problem should solved with docker.

Any thoughts are much appreciated.  
sg
