code: def exists(name):
      '''
      Check if a given container exists
  
      name
          Container name or ID
  
  
      **RETURN DATA**
  
      A boolean (``True`` if the container exists, otherwise ``False``)
  
  
      CLI Example:
  
      .. code-block:: bash
  
          salt myminion docker.exists mycontainer
      '''
      contextkey = 'docker.exists.{0}'.format(name)
      if contextkey in __context__:
          return __context__[contextkey]
      try:
          c_info = _client_wrapper('inspect_container',
                                   name,
                                   catch_api_errors=False)
      except docker.errors.APIError:
          __context__[contextkey] = False
      else:
          __context__[contextkey] = True
      return __context__[contextkeyf exists(name):
      '''
      Check if a given container exists
  
      name
          Container name or ID
  
  
      **RETURN DATA**
  
      A boolean (``True`` if the container exists, otherwise ``False``)
  
  
      CLI Example:
  
      .. code-block:: bash
  
          salt myminion docker.exists mycontainer
      '''
      contextkey = 'docker.exists.{0}'.format(name)
      if contextkey in __context__:
          return __context__[contextkey]
      try:
          c_info = _client_wrapper('inspect_container',
                                   name,
                                   catch_api_errors=False)
      except docker.errors.APIError:
          __context__[contextkey] = False
      else:
          __context__[contextkey] = True
      return __context__[contextkey]
docs: Check if a given container exists
  
      name
          Container name or ID
  
  
      **RETURN DATA**
  
      A boolean (``True`` if the container exists, otherwise ``False``)
  
  
      CLI Example:
  
      .. code-block:: bash
  
          salt myminion docker.exists mycontainer