This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def runningInDocker(): | |
with open('/proc/self/cgroup', 'r') as procfile: | |
for line in procfile: | |
fields = line.strip().split('/') | |
if fields[1] == 'docker': | |
return True | |
return False |