### Is there an existing issue for this?

- [X] I have searched the existing issues

### Current Behavior

I'm using localstack in docker-compose to test a lambda function. The lambda is in a docker image and gets triggered when a file is uploaded to s3. 

Here is the localstack docker-compose setup
```yml
localstack:
    image: localstack/localstack:latest
    ports:
      - 4566:4566
    environment:
      SERVICES: s3,sns,lambda,iam
      AWS_DEFAULT_REGION: us-west-2
      LAMBDA_EXECUTOR: docker-reuse
      LAMBDA_REMOVE_CONTAINERS: 0
      LOCALSTACK_API_KEY: ${LOCALSTACK_API_KEY}
    volumes:
     - ./localstack-init-scripts:/docker-entrypoint-initaws.d
     - "/var/run/docker.sock:/var/run/docker.sock"
```

And here is the localstack error that happens when the lambda is triggered.
```bash
localstack_1        | 2021-12-15T20:09:24.960:ERROR:localstack_ext.services.awslambda.lambda_extended: Unable to invoke Lambda "arn:aws:lambda:us-west-2:000000000000:function:kb-service-upload-handler": 
localstack_1        | Traceback (most recent call last):
localstack_1        |   File "/opt/code/localstack/.venv/lib/python3.8/site-packages/docker/api/client.py", line 268, in _raise_for_status
localstack_1        |     response.raise_for_status()
localstack_1        |   File "/opt/code/localstack/.venv/lib/python3.8/site-packages/requests/models.py", line 943, in raise_for_status
localstack_1        |     raise HTTPError(http_error_msg, response=self)
localstack_1        | requests.exceptions.HTTPError: 400 Client Error: Bad Request for url: http+docker://localhost/v1.41/containers/cea0db10eafcec866aaedb6d45048e060f978d44843dae4e9282a1fb75340837/start
localstack_1        | 
localstack_1        | During handling of the above exception, another exception occurred:
localstack_1        | 
localstack_1        | Traceback (most recent call last):
localstack_1        |   File "/opt/code/localstack/localstack/utils/docker_utils.py", line 1413, in start_container
localstack_1        |     container.start()
localstack_1        |   File "/opt/code/localstack/.venv/lib/python3.8/site-packages/docker/models/containers.py", line 404, in start
localstack_1        |     return self.client.api.start(self.id, **kwargs)
localstack_1        |   File "/opt/code/localstack/.venv/lib/python3.8/site-packages/docker/utils/decorators.py", line 19, in wrapped
localstack_1        |     return f(self, resource_id, *args, **kwargs)
localstack_1        |   File "/opt/code/localstack/.venv/lib/python3.8/site-packages/docker/api/container.py", line 1111, in start
localstack_1        |     self._raise_for_status(res)
localstack_1        |   File "/opt/code/localstack/.venv/lib/python3.8/site-packages/docker/api/client.py", line 270, in _raise_for_status
localstack_1        |     raise create_api_error_from_http_exception(e)
localstack_1        |   File "/opt/code/localstack/.venv/lib/python3.8/site-packages/docker/errors.py", line 31, in create_api_error_from_http_exception
localstack_1        |     raise cls(e, response=response, explanation=explanation)
localstack_1        | docker.errors.APIError: 400 Client Error for http+docker://localhost/v1.41/containers/cea0db10eafcec866aaedb6d45048e060f978d44843dae4e9282a1fb75340837/start: Bad Request ("OCI runtime create failed: container_linux.go:380: starting container process caused: exec: "/tmp/e965911c.sh": stat /tmp/e965911c.sh: no such file or directory: unknown")
localstack_1        | 
localstack_1        | During handling of the above exception, another exception occurred:
localstack_1        | 
localstack_1        | Traceback (most recent call last):
localstack_1        |   File "/opt/code/localstack/.venv/lib/python3.8/site-packages/localstack_ext/services/awslambda/lambda_extended.py.enc", line 458, in do_run_lambda_executor
localstack_1        |   File "/opt/code/localstack/.venv/lib/python3.8/site-packages/localstack_ext/services/awslambda/lambda_launcher.py.enc", line 343, in docker_reuse_execute_in_container
localstack_1        |   File "/opt/code/localstack/.venv/lib/python3.8/site-packages/localstack_ext/services/awslambda/lambda_launcher.py.enc", line 242, in custom_image_execute_in_container
localstack_1        |   File "/opt/code/localstack/localstack/utils/docker_utils.py", line 1541, in run_container
localstack_1        |     result = self.start_container(
localstack_1        |   File "/opt/code/localstack/localstack/utils/docker_utils.py", line 1418, in start_container
localstack_1        |     raise ContainerException()
localstack_1        | localstack.utils.docker_utils.ContainerException
localstack_1        | 2021-12-15T20:09:24.960:INFO:localstack_ext.services.awslambda.lambda_extended: Lambda container output: None
localstack_1        | None
```

The lambda is getting created like this
```bash
awslocal lambda create-function \
  --function-name kb-service-upload-handler \
  --code ImageUri=kb-service-upload-handler \
  --role arn:aws:iam::000000000000:role/test \
  --handler "src.upload_handler.main.handler" \
  --package-type Image
```

It appears the code inside the lambda never gets invoked.

### Expected Behavior

The lambda should be invoked successfully.

### How are you starting LocalStack?

With a docker-compose file

### Steps To Reproduce

#### How are you starting localstack (e.g., `bin/localstack` command, arguments, or `docker-compose.yml`)
```
    docker-compose up
```
#### Client commands (e.g., AWS SDK code snippet, or sequence of "awslocal" commands)

```
awslocal lambda create-function \
  --function-name kb-service-upload-handler \
  --code ImageUri=kb-service-upload-handler \
  --role arn:aws:iam::000000000000:role/test \
  --handler "src.upload_handler.main.handler" \
  --package-type Image

awslocal s3api put-bucket-notification-configuration \
  --bucket client-uploads \
  --notification-configuration file://notification.json
```


### Environment

```markdown
- OS: Ubuntu
- LocalStack: latest
```


### Anything else?

_No response_
import base64
import datetime
import json
import logging
import re
import time
from typing import Any, Dict, Optional, Tuple, Union
from urllib.parse import urljoin
import pytz
import requests
from flask import Response as FlaskResponse
from jsonschema import ValidationError, validate
from requests.models import Response
from localstack import config
from localstack.constants import (
    APPLICATION_JSON,
    HEADER_LOCALSTACK_AUTHORIZATION,
    HEADER_LOCALSTACK_EDGE_URL,
    LOCALHOST_HOSTNAME,
    PATH_USER_REQUEST,
    TEST_AWS_ACCOUNT_ID,
)
from localstack.services.apigateway import helpers