def get_current_container_id(read_from='<STR_LIT>'):
if not os.path.exists(read_from):<EOL><INDENT>return<EOL><DEDENT>with open(read_from, '<STR_LIT:r>') as cgroup:<EOL><INDENT>for line in cgroup:<EOL><INDENT>if re.match('<STR_LIT>', line.strip()):<EOL><INDENT>return re.sub('<STR_LIT>', '<STR_LIT>', line.strip())<EOL><DEDENT><DEDENT><DEDENT>
Get the ID of the container the application is currently running in,
otherwise return `None` if not running in a container.

This is a best-effort guess, based on cgroups.

:param read_from: the cgroups file to read from (default: `/proc/self/cgroup`)