code: def get_docker_commands(authorized_keys: List[str]) -> List[str]:
      authorized_keys = "\n".join(authorized_keys).strip()
      commands = [
          # note: &> redirection doesn't work in /bin/sh
          # check in sshd is here, install if not
          (
              "if ! command -v sshd >/dev/null 2>&1; then { "
              "apt-get update && DEBIAN_FRONTEND=noninteractive apt-get install -y openssh-server; "
              "} || { "
              "yum -y install openssh-server; "
              "}; fi"
          ),
          # prohibit password authentication
          'sed -i "s/.*PasswordAuthentication.*/PasswordAuthentication no/g" /etc/ssh/sshd_config',
          # create ssh dirs and add public key
          "mkdir -p /run/sshd ~/.ssh",
          "chmod 700 ~/.ssh",
          f"echo '{authorized_keys}' > ~/.ssh/authorized_keys",
          "chmod 600 ~/.ssh/authorized_keys",
          # preserve environment variables for SSH clients
          "env >> ~/.ssh/environment",
          'echo "export PATH=$PATH" >> ~/.profile',
          # regenerate host keys
          "rm -rf /etc/ssh/ssh_host_*",
          "ssh-keygen -A > /dev/null",
          # start sshd
          "/usr/sbin/sshd -p 10022 -o PermitUserEnvironment=yes",
      ]
      build = get_dstack_runner_version()
      runner = "/usr/local/bin/dstack-runner"
      bucket = "dstack-runner-downloads-stgn"
      if settings.DSTACK_VERSION is not None:
          bucket = "dstack-runner-downloads"
      commands += [
          f'curl --output {runner} "https://{bucket}.s3.eu-west-1.amazonaws.com/{build}/binaries/dstack-runner-linux-amd64"',
          f"chmod +x {runner}",
          f"{runner} --log-level 6 start --http-port 10999 --temp-dir /tmp/runner --home-dir /root --working-dir /workflow",
      ]
      return commands
  
imports: import os
  import re
  from abc import ABC, abstractmethod
  from typing import List, Optional
  import git
  import requests
  import yaml
  from dstack import version
  from dstack._internal import settings
  from dstack._internal.core.models.backends.base import BackendType
  from dstack._internal.core.models.instances import InstanceOfferWithAvailability, InstanceState, LaunchedGatewayInfo, LaunchedInstanceInfo
  from dstack._internal.core.models.runs import Job, Requirements, Run
  from dstack._internal.utils.logging import get_logger
label_desc: Use image node_id 9 for calling a global function with example usage: get_docker_commands(authorized_keys) and returns: commands