'Create docker container'

def create_container(self):

    client = self.get_client()
    image = self.container_image
    if self.project.container_image:
        image = self.project.container_image
    try:
        self.container = client.create_container(image=image, command='/bin/sh    -c    "sleep    {time};    exit    {exit}"'.format(time=self.container_time_limit, exit=DOCKER_TIMEOUT_EXIT_CODE), name=self.container_id, hostname=self.container_id, host_config=create_host_config(binds={SPHINX_TEMPLATE_DIR: {'bind': SPHINX_TEMPLATE_DIR, 'mode': 'ro'}, MKDOCS_TEMPLATE_DIR: {'bind': MKDOCS_TEMPLATE_DIR, 'mode': 'ro'}, self.project.doc_path: {'bind': self.project.doc_path, 'mode': 'rw'}}), detach=True, environment=self.environment, mem_limit=self.container_mem_limit)
        client.start(container=self.container_id)
    except DockerAPIError as e:
        log.error(LOG_TEMPLATE.format(project=self.project.slug, version=self.version.slug, msg=e.explanation), exc_info=True)
        raise BuildEnvironmentError('Build    environment    creation    failed')
