code: def _dockerKill(containerName, action):
      
      running = containerIsRunning(containerName)
      if running is None:
          # This means that the container doesn't exist.  We will see this if the
          # container was run with --rm and has already exited before this call.
          logger.debug('The container with name "%s" appears to have already been '
                      'removed.  Nothing to '
                    'do.', containerName)
      else:
          if action in (None, FORGO):
              logger.debug('The container with name %s continues to exist as we '
                          'were asked to forgo a '
                        'post-job action on it.', containerName)
          else:
              logger.debug('The container with name %s exists. Running '
                          'user-specified defer functions.',
                           containerName)
              if running and action >= STOP:
                  logger.debug('Stopping container "%s".', containerName)
                  for attempt in retry(predicate=dockerPredicate):
                      with attempt:
                          subprocess.check_call(['docker', 'stop', containerName])
              else:
                  logger.debug('The container "%s" was not found to be running.',
                              containerName)
              if action >= RM:
                  # If the container was run with --rm, then stop will most likely
                  # remove the container.  We first check if it is running then
                  # remove it.
                  running = containerIsRunning(containerName)
                  if running is not None:
                      logger.debug('Removing container "%s".', containerName)
                      for attempt in retry(predicate=dockerPredicate):
                          with attempt:
                              subprocess.check_call(['docker', 'rm', '-f',
                                                     containerName])
                  else:
                      logger.debug('Container "%s" was not found on the system.'
                                  'Nothing to remove.',
                                   containerName)
docs: Deprecated.  Kills the specified container.
      :param str containerName: The name of the container created by docker_call
      :param int action: What action should be taken on the container?