def create(self):
if self.is_created():<EOL><INDENT>raise RuntimeError("<STR_LIT>")<EOL><DEDENT>LOG.info("<STR_LIT>", self._host_dir, self._working_dir)<EOL>kwargs = {<EOL>"<STR_LIT>": self._cmd,<EOL>"<STR_LIT>": self._working_dir,<EOL>"<STR_LIT>": {<EOL>self._host_dir: {<EOL>"<STR_LIT>": self._working_dir,<EOL>"<STR_LIT>": "<STR_LIT>"<EOL>}<EOL>},<EOL>"<STR_LIT>": False<EOL>}<EOL>if self._container_opts:<EOL><INDENT>kwargs.update(self._container_opts)<EOL><DEDENT>if self._additional_volumes:<EOL><INDENT>kwargs["<STR_LIT>"].update(self._additional_volumes)<EOL><DEDENT>kwargs["<STR_LIT>"] = {to_posix_path(host_dir): mount for host_dir, mount in kwargs["<STR_LIT>"].items()}<EOL>if self._env_vars:<EOL><INDENT>kwargs["<STR_LIT>"] = self._env_vars<EOL><DEDENT>if self._exposed_ports:<EOL><INDENT>kwargs["<STR_LIT>"] = self._exposed_ports<EOL><DEDENT>if self._entrypoint:<EOL><INDENT>kwargs["<STR_LIT>"] = self._entrypoint<EOL><DEDENT>if self._memory_limit_mb:<EOL><INDENT>kwargs["<STR_LIT>"] = "<STR_LIT>".format(self._memory_limit_mb)<EOL><DEDENT>if self.network_id == '<STR_LIT:host>':<EOL><INDENT>kwargs["<STR_LIT>"] = self.network_id<EOL><DEDENT>real_container = self.docker_client.containers.create(self._image, **kwargs)<EOL>self.id = real_container.id<EOL>if self.network_id and self.network_id != '<STR_LIT:host>':<EOL><INDENT>network = self.docker_client.networks.get(self.network_id)<EOL>network.connect(self.id)<EOL><DEDENT>return self.id<EOL>
Calls Docker API to creates the Docker container instance. Creating the container does *not* run the container.
Use ``start`` method to run the container

:return string: ID of the created container
:raise RuntimeError: If this method is called after a container already has been created