I am trying to create 2 docker images simultaneously but images are creating one after another. Where am I going wrong here??
import docker
import multiprocessing as mp
class Docker():
    def __init__(self):
        self.client = docker.from_env()
    def get_all_containers(self):
        containers=self.client.containers.list(all=True)
        return (containers)
    def image_build(self,path,file,tag):
        self.client.images.build(path=path, dockerfile=file, tag=tag, rm=True, nocache=True)
    def initiate(self):
        print ("building image")
        t1=mp.Process(target=self.image_build(path="/home/rohith/Desktop/proj/poc/", file="login_service", tag="login_service"))
        print ("initiated t1 and now going to t2")
        t2=mp.Process(target=self.image_build(path="/home/rohith/Desktop/proj/poc/", file="login_mongo", tag="mongo_service"))
        t1.start()
        t2.start()
        print ("Done with the images for login_service now implement to run a container. First db has to be initiated and later login_service")
if __name__=="__main__":
    doc=Docker()
    doc.initiate()
Let me know if you need my docker files as well.
 
     
    