cwltool.docker_id
=================

.. py:module:: cwltool.docker_id

.. autoapi-nested-parse::

   Helper functions for docker.



Functions
---------

.. autoapisummary::

   cwltool.docker_id.docker_vm_id
   cwltool.docker_id.check_output_and_strip
   cwltool.docker_id.docker_machine_name
   cwltool.docker_id.cmd_output_matches
   cwltool.docker_id.boot2docker_running
   cwltool.docker_id.docker_machine_running
   cwltool.docker_id.cmd_output_to_int
   cwltool.docker_id.boot2docker_id
   cwltool.docker_id.docker_machine_id


Module Contents
---------------

.. py:function:: docker_vm_id()

   Return the User ID and Group ID of the default docker user inside the VM.

   When a host is using boot2docker or docker-machine to run docker with
   boot2docker.iso (As on Mac OS X), the UID that mounts the shared filesystem
   inside the VirtualBox VM is likely different than the user's UID on the host.
   :return: A tuple containing numeric User ID and Group ID of the docker account inside
   the boot2docker VM


.. py:function:: check_output_and_strip(cmd)

   Pass a command list to :py:func:`subprocess.check_output`.

   Returning None if an expected exception is raised
   :param cmd: The command to execute
   :return: Stripped string output of the command, or ``None`` if error


.. py:function:: docker_machine_name()

   Get the machine name of the active docker-machine machine.

   :return: Name of the active machine or ``None`` if error


.. py:function:: cmd_output_matches(check_cmd, expected_status)

   Run a command and compares output to expected.

   :param check_cmd: Command list to execute
   :param expected_status: Expected output, e.g. "Running" or "poweroff"
   :return: Boolean value, indicating whether or not command result matched


.. py:function:: boot2docker_running()

   Check if boot2docker CLI reports that boot2docker vm is running.

   :return: ``True`` if vm is running, ``False`` otherwise


.. py:function:: docker_machine_running()

   Ask docker-machine for the active machine and checks if its VM is running.

   :return: ``True`` if vm is running, ``False`` otherwise


.. py:function:: cmd_output_to_int(cmd)

   Run the provided command and returns the integer value of the result.

   :param cmd: The command to run
   :return: Integer value of result, or None if an error occurred


.. py:function:: boot2docker_id()

   Get the UID and GID of the docker user inside a running boot2docker vm.

   :return: Tuple (UID, GID), or (None, None) if error (e.g. boot2docker not present or stopped)


.. py:function:: docker_machine_id()

   Ask docker-machine for active machine and gets the UID of the docker user.

   inside the vm
   :return: tuple (UID, GID), or (None, None) if error (e.g. docker-machine not present or stopped)


