### Is there an existing issue for this?

- [X] I have searched the existing issues

### Current Behavior

- following the [installation steps](https://docs.localstack.cloud/getting-started/installation/) fails when validating localstack configuration

- error
![image](https://github.com/localstack/localstack/assets/10324554/d82ef62e-c8b8-402e-8195-e691733cfeb1)

- localstack is indeed running
![image](https://github.com/localstack/localstack/assets/10324554/44d7180a-5090-416d-afa9-c4eaaedca33e)


### Expected Behavior

- localstack can consume the path I pass `--file`

### 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 -d
    localstack config validate --file ./compose.yaml


### Environment

```markdown
OS: Ubuntu 20.04
    LocalStack: latest
```


### Anything else?

- you can reproduce [on this branch](https://github.com/noahehall/localstack/tree/rds) if it still exists
  - else switch to the develop branch
"""
    Configuration routine for the LocalstackContainer.
    """
    
    user_flags = config.DOCKER_FLAGS
    user_flags = extract_port_flags(user_flags, container.ports)
    container.additional_flags.extend(shlex.split(user_flags))
    
    hooks.configure_localstack_container.run(container)
    
    container.ports.add(get_edge_port_http())
    for port in range(config.EXTERNAL_SERVICE_PORTS_START, config.EXTERNAL_SERVICE_PORTS_END):
        container.ports.add(port)
    if config.DEVELOP:
        container.ports.add(config.DEVELOP_PORT)
    
    
    for env_var in config.CONFIG_ENV_VARS:
        value = os.environ.get(env_var, None)
        if value is not None:
            container.env_vars[env_var] = value
    container.env_vars["DOCKER_HOST"] = f"unix://{config.DOCKER_SOCK}"
    
    
    container.env_vars["SET_TERM_HANDLER"] = "1"
    configure_volume_mounts(container)
    
    container.volumes.append((config.DOCKER_SOCK, config.DOCKER_SOCK))
    container.privileged = True
def configure_volume_mounts(container: LocalstackContainer):