Start Docker container from Docker SDK

My Python code with Docker SDK is running within the container. I need to start an additional docker container, pass input data files and wait for the container to run till completion. What will be the best solution:

  1. Run docker within docker? (that mean to register a new image within docker and start the container)
  2. Somehow access docker Engine, and ask it to run the second docker? (if so, where can I find any sample of this solution)
  3. start two dockers and connect with REST API (The worst solution in my case, since each docker, require a lot of resources)
  4. Any other solution will be nice to hear and test!!!!!!!!!!!!!

Source: Docker Questions

LEAVE A COMMENT