The lambda execution is not suspending and the lambda container has no port exposed when running a java 11 lambda with the latest localstack docker image by docker-compose with the environment variable LAMBDA_JAVA_OPTS=-agentlib:jdwp=transport=dt_socket,server=y,suspend=y,address=_debug_port_
    
It works fine for java8 runtime executions.

Docker command:

> localstack_1  | 2020-01-26T12:42:04:INFO:localstack.services.awslambda.lambda_executors: Running lambda cmd: CONTAINER_ID="$(docker create -i   -e ENV="$ENV" -e DOCKER_LAMBDA_USE_STDIN="$DOCKER_LAMBDA_USE_STDIN" -e HOSTNAME="$HOSTNAME" -e LOCALSTACK_HOSTNAME="$LOCALSTACK_HOSTNAME" -e AWS_LAMBDA_FUNCTION_TIMEOUT="$AWS_LAMBDA_FUNCTION_TIMEOUT" -e AWS_LAMBDA_FUNCTION_NAME="$AWS_LAMBDA_FUNCTION_NAME" -e AWS_LAMBDA_FUNCTION_VERSION="$AWS_LAMBDA_FUNCTION_VERSION" -e AWS_LAMBDA_FUNCTION_INVOKED_ARN="$AWS_LAMBDA_FUNCTION_INVOKED_ARN"  --rm "lambci/lambda:java11" "com.XXX.XXX.Handler")";docker cp "/tmp/localstack/zipfile.0c90736c/." "$CONTAINER_ID:/var/task"; docker start -ai "$CONTAINER_ID";

I think this is due to the fact that the classpath arguments and java opts are only being set if the rutime is equal to LAMBDA_RUNTIME_JAVA8 (line 211 of ocalstack/localstack/services/awslambda/lambda_executors.py , commit 03c6f4bf250edd18eb818ed65090f508636b0bff)
environment['DOCKER_LAMBDA_USE_STDIN'] = '1'
        return event_body.encode()
    def prepare_execution(self, func_arn, env_vars, runtime, command, handler, lambda_cwd):
        entrypoint = ''
        if command:
            entrypoint = ' --entrypoint ""'
        else:
            command = '"%s"' % handler
        
        network = config.LAMBDA_DOCKER_NETWORK
        network_str = '--network="%s"' % network if network else ''
        if network == 'host':
            port = str(self.next_port + self.port_offset)
            env_vars['DOCKER_LAMBDA_API_PORT'] = port
            env_vars['DOCKER_LAMBDA_RUNTIME_PORT'] = port
            self.next_port = (self.next_port + 1) % self.max_port
        env_vars_string = ' '.join(['-e {}="${}"'.format(k, k) for (k, v) in env_vars.items()])
        debug_docker_java_port = '-p {p}:{p}'.format(p=Util.debug_java_port) if Util.debug_java_port else ''
        docker_cmd = self._docker_cmd()
        docker_image = Util.docker_image_for_runtime(runtime)
        rm_flag = Util.get_docker_remove_flag()
        if config.LAMBDA_REMOTE_DOCKER:
            cmd = (
                'CONTAINER_ID="$(%s create -i'
                ' %s'  
                ' %s'  
                ' %s'  
                ' %s'  
                ' %s'