## Problem
Currently, even if `LAMBDA_REMOTE_DOCKER=1`, we unzip the zip files in the directory they are in, which is usually /var/lib/localstack, which usually has a bind mount to the host.
On docker desktop, due to the use of grpc-FUSE (on macos), this can be very slow, about 200 times slower than on volumes / directly on the host. With experimental virtio filesystem enabled (also on macos), this can be reduced to about 30 times as slow, but still problematic.
This means a lambda may take a lot of time processing, for each additional layer some more. This especially affects nodejs lambdas with huge node_modules folders.

## Probable solution
At least if `LAMBDA_REMOTE_DOCKER=1`, we should leave the initial zip files on the bind mount (for persistence etc), but the working directories after unzipping should be located on non-bind mounts, to speed up the IO for unzipping.
wait_for_port_open,
)
from localstack.utils.container_networking import get_main_container_name
from localstack.utils.container_utils.container_client import (
    ContainerConfiguration,
    ContainerException,
    DockerContainerStatus,
    PortMappings,
)
from localstack.utils.docker_utils import DOCKER_CLIENT, get_default_volume_dir_mount
from localstack.utils.run import FuncThread
LAMBDA_EXECUTOR_JAR = INSTALL_PATH_LOCALSTACK_FAT_JAR
LAMBDA_EXECUTOR_CLASS = "cloud.localstack.LambdaExecutor"
LAMBDA_HANDLER_ENV_VAR_NAME = "_HANDLER"
EVENT_FILE_PATTERN = "%s/lambda.event.*.json" % config.dirs.tmp
LAMBDA_SERVER_UNIQUE_PORTS = 500
LAMBDA_SERVER_PORT_OFFSET = 5000
LAMBDA_API_UNIQUE_PORTS = 500
LAMBDA_API_PORT_OFFSET = 9000
MAX_ENV_ARGS_LENGTH = 20000
STAY_OPEN_API_PORT = 9001
INTERNAL_LOG_PREFIX = "ls-daemon: "
LOG = logging.getLogger(__name__)
MAX_CONTAINER_IDLE_TIME_MS = 600 * 1000
EVENT_SOURCE_SQS = "aws:sqs"
LAMBDA_CONCURRENCY_LOCK = {}
DOCKER_TASK_FOLDER = "/var/task"
ALLOWED_IDENTITY_FIELDS = ["cognitoIdentityId", "cognitoIdentityPoolId"]
LambdaEvent = Union[Dict[str, Any], str, bytes]
HOOKS_ON_LAMBDA_DOCKER_SEPARATE_EXECUTION = "localstack.hooks.on_docker_separate_execution"