python docker mount掛載

container = client.containers.create(name = "bs"+str(port), image = "zmj/bs", 
                                    labels = {"host":str(relayHost),"port":str(port),"relay":str(relayId)}, 
                                    environment = ["SERVER_ADDR="+H["publicHost"],
									"SERVER_PORT="+str(port),
									"RELAY_ADDR="+str(relayHost),
									"RELAY_PORT="+str(relayPort)],
                                    mounts = [docker.types.Mount(target = self.config["workDir"], source = H["serverDir"],type = 'bind')],
                                    #create_host_config = {binds : [H["serverDir"]+":"+self.config["workDir"]]},
                                    ports = {str(port) +'/tcp': port},
                                    working_dir = str(self.config["workDir"]),
                                    tty = True,
                                    detach = True
                           )
                #client.containers.get("bs"+str(port)).start()
                container.start()
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章