def ssh_cmd_docker_container_exec(
    detail, command_on_docker, wait_press_key=None
) -> str:
    """SSH command to execute a command inside a docker containter."""
    wait_cmd = ""
    if wait_press_key:
        wait_cmd = "; echo 'Press a key'; read q"
    return (
        f"TERM=xterm ssh -t {detail['ec2InstanceId']} docker exec -ti {detail['runtimeId']} {command_on_docker}"
        + wait_cmd
    )