src/hivemined/container.py
def create(self, force=False, **kwargs):
        """Create a new managed docker container.

        If force==True, create new a container even if one already exists.
        Propagates LookupError from self.image.get() f the image does not exist and cannot be pulled or built,
        Raises Warning if container creation resulted in warnings form Docker.
        """
        labels = {type(self).label: None, 'name': self.name}
        if self.exists() and not force:
            return

        try:
            self.image.get()    # Ensure that the specified Image exists.
        except LookupError as e:
            print(e)
            raise

        volume_list = []
        for v in self.volumes:
            volume_list.append(v.container.get("Id"))

        if self.port:
            host_cfg = docker.utils.create_host_config(
                volumes_from=volume_list, restart_policy=self.restart, port_bindings={25565: int(self.port)})
        else:
            host_cfg = docker.utils.create_host_config(
                volumes_from=volume_list, restart_policy=self.restart, publish_all_ports=True)

        self.container = Docker.create_container(
            host_config=host_cfg, labels=labels, image=self.image.name, command=self.command,
            mem_limit=self.limits.get('memory'), memswap_limit=self.limits.get('swap'),
            cpu_shares=self.limits.get('cpu'), **kwargs)

        if self.container.get('Warnings'):
            raise Warning("Container creation warning.", self)
Create a new managed docker container.

        If force==True, create new a container even if one already exists.
        Propagates LookupError from self.image.get() f the image does not exist and cannot be pulled or built,
        Raises Warning if container creation resulted in warnings form Docker.
        
Create a new managed docker container.
If force==True, create new a container even if one already exists.
Propagates LookupError from self.image.get() f the image does not exist and cannot be pulled or built,
Raises Warning if container creation resulted in warnings form Docker.
Create a new managed docker container . If force == True create new a container even if one already exists . Propagates LookupError from self . image . get () f the image does not exist and cannot be pulled or built Raises Warning if container creation resulted in warnings form Docker .
def create(self, force=False, **kwargs):
        labels = {type(self).label: None, 'name': self.name}
        if self.exists() and not force:
            return
        try:
            self.image.get()    
        except LookupError as e:
            print(e)
            raise
        volume_list = []
        for v in self.volumes:
            volume_list.append(v.container.get("Id"))
        if self.port:
            host_cfg = docker.utils.create_host_config(
                volumes_from=volume_list, restart_policy=self.restart, port_bindings={25565: int(self.port)})
        else:
            host_cfg = docker.utils.create_host_config(
                volumes_from=volume_list, restart_policy=self.restart, publish_all_ports=True)
        self.container = Docker.create_container(
            host_config=host_cfg, labels=labels, image=self.image.name, command=self.command,
            mem_limit=self.limits.get('memory'), memswap_limit=self.limits.get('swap'),
            cpu_shares=self.limits.get('cpu'), **kwargs)
        if self.container.get('Warnings'):
            raise Warning("Container creation warning.", self)
def create ( self , force = False , ** kwargs ) : labels = { type ( self ) . label : None , 'name' : self . name } if self . exists ( ) and not force : return try : self . image . get ( ) except LookupError as e : print ( e ) raise volume_list = [ ] for v in self . volumes : volume_list . append ( v . container . get ( "Id" ) ) if self . port : host_cfg = docker . utils . create_host_config ( volumes_from = volume_list , restart_policy = self . restart , port_bindings = { 25565 : int ( self . port ) } ) else : host_cfg = docker . utils . create_host_config ( volumes_from = volume_list , restart_policy = self . restart , publish_all_ports = True ) self . container = Docker . create_container ( host_config = host_cfg , labels = labels , image = self . image . name , command = self . command , mem_limit = self . limits . get ( 'memory' ) , memswap_limit = self . limits . get ( 'swap' ) , cpu_shares = self . limits . get ( 'cpu' ) , ** kwargs ) if self . container . get ( 'Warnings' ) : raise Warning ( "Container creation warning." , self )
Create a new managed docker container.
Create a new managed docker container .
"""Create a new managed docker container.

        If force==True, create new a container even if one already exists.
        Propagates LookupError from self.image.get() f the image does not exist and cannot be pulled or built,
        Raises Warning if container creation resulted in warnings form Docker.
        """ # Ensure that the specified Image exists.
self
force