docs: def build_docker_run_command(configuration):
      """
      Translate a declarative docker `configuration` to a `docker run` command.
  
      Parameters
      ----------
      configuration : dict
          configuration
  
      Returns
      -------
      args : list
          sequence of command line arguments to run a command in a container
      """
      parts = configuration.pop('docker').split()
      parts.append('run')
  
      run = configuration.pop('run')
  
      # Ensure all env-files have proper paths
      if 'env-file' in run:
          run['env-file'] = [os.path.join(configuration['workspace'], env_file)
                             for env_file in run['env-file']]
  
      parts.extend(build_parameter_parts(
          run, 'user', 'workdir', 'rm', 'interactive', 'tty', 'env-file', 'cpu-shares', 'name',
          'network', 'label', 'memory', 'entrypoint', 'runtime', 'privileged', 'group-add'
      ))
  
      # Add the mounts
      # The following code requires docker >= 17.06
      '''for mount in run.pop('mount', []):
          if mount['type'] == 'bind':
              mount['source'] = os.path.join(
                  configuration['workspace'], mount['source'])
          parts.extend(['--mount', ",".join(["%s=%s" % item for item in mount.items()])])'''
  
      # Add the mounts
      for mount in run.pop('mount', []):
          if mount['type'] == 'tmpfs':
              raise RuntimeError('tmpfs-mounts are currently not supported via the mount ' +
                                 'directive in docker_interface. Consider using the tmpfs ' +
                                 'directive instead.')
          if mount['type'] == 'bind':
             mount['source'] = os.path.abspath(
                 os.path.join(configuration['workspace'], mount['source']))
          vol_config = '--volume=%s:%s' % (mount['source'], mount['destination'])
          if 'readonly' in mount and mount['readonly']:
              vol_config += ':ro'
          parts.append(vol_config)
  
      # Set or forward environment variables
      for key, value in run.pop('env', {}).items():
          if value is None:
              parts.append('--env=%s' % key)
          else:
              parts.append('--env=%s=%s' % (key, value))
      parts.append('--env=DOCKER_INTERFACE=true')
  
      # Forward ports
      for publish in run.pop('publish', []):
          parts.append('--publish=%s:%s:%s' % tuple([
              publish.get(key, '') for key in "ip host container".split()]))
  
      # Add temporary file systems
      for tmpfs in run.pop('tmpfs', []):
          destination = tmpfs['destination']
          options = tmpfs.pop('options', [])
          for key in ['mode', 'size']:
              if key in tmpfs:
                  options.append('%s=%s' % (key, tmpfs[key]))
          if options:
              destination = "%s:%s" % (destination, ",".join(options))
          parts.extend(['--tmpfs', destination])
  
      parts.append(run.pop('image'))
      parts.extend(run.pop('cmd', []))
  
      return parts