def build_image_dockerhost(self, build_image, json_args_path):
        """
        Build docker image inside privileged container using docker from host
        (mount docker socket inside container).
        There are possible races here. Use wisely.

        This operation is asynchronous and you should wait for container to finish.

        :param build_image: str, name of image where build is performed
        :param json_args_path: str, this dir is mounted inside build container and used
                               as a way to transport data between host and buildroot; there
                               has to be a file inside this dir with name
                               atomic_reactor.BUILD_JSON which is used to feed build
        :return: str, container id
        """
        logger.info("building image '%s' in container using docker from host", build_image)

        self._check_build_input(build_image, json_args_path)
        self._obtain_source_from_path_if_needed(json_args_path, CONTAINER_SHARE_PATH)

        if not os.path.exists(DOCKER_SOCKET_PATH):
            logger.error("looks like docker is not running because there is no socket at: %s",
                         DOCKER_SOCKET_PATH)
            raise RuntimeError("docker socket not found: %s" % DOCKER_SOCKET_PATH)

        volume_bindings = {
            DOCKER_SOCKET_PATH: {
                'bind': DOCKER_SOCKET_PATH,
            },
            json_args_path: {
                'bind': CONTAINER_SHARE_PATH,
            },
        }

        if self._volume_bind_understands_mode():
            volume_bindings[DOCKER_SOCKET_PATH]['mode'] = 'ro'
            volume_bindings[json_args_path]['mode'] = 'rw,Z'
        else:
            volume_bindings[DOCKER_SOCKET_PATH]['ro'] = True
            volume_bindings[json_args_path]['rw'] = True

        with open(os.path.join(json_args_path, BUILD_JSON)) as fp:
            logger.debug('build json mounted in container: %s', fp.read())

        container_id = self.tasker.run(
            ImageName.parse(build_image),
            create_kwargs={'volumes': [DOCKER_SOCKET_PATH, json_args_path]},
            volume_bindings=volume_bindings,
            privileged=True,
        )

        return container_id
Build docker image inside privileged container using docker from host
        (mount docker socket inside container).
        There are possible races here. Use wisely.

        This operation is asynchronous and you should wait for container to finish.

        :param build_image: str, name of image where build is performed
        :param json_args_path: str, this dir is mounted inside build container and used
                               as a way to transport data between host and buildroot; there
                               has to be a file inside this dir with name
                               atomic_reactor.BUILD_JSON which is used to feed build
        :return: str, container id