<div dir="ltr">Googling around, there are a few ways.<div><br></div><div>It looks like this could be the most consistent:</div><div><br></div><div><font face="monospace">grep -E ":/docker/.+$" /proc/1/cgroup</font></div><div><br></div><div>..which is looking for cgroups under a docker cgroup</div><div><br clear="all"><div><div dir="ltr" class="gmail_signature" data-smartmail="gmail_signature"><div>It may be refined to:</div><div><br></div><div><font face="monospace">grep -E ":/docker/[0-9a-f]+$" /proc/1/cgroup</font><br></div><div><br></div><div>..but I can't say that for sure.</div><div><br></div><div>What do you think, does that sound reasonable ?</div><div><br></div><div><br></div>Cheers,<div>Just</div></div></div><br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Wed, 28 Apr 2021 at 07:58, Thomas Lange <<a href="mailto:lange@cs.uni-koeln.de">lange@cs.uni-koeln.de</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">>>>>> On Tue, 27 Apr 2021 21:05:37 +0100, Justin Cattle <<a href="mailto:j@ocado.com" target="_blank">j@ocado.com</a>> said:<br>
<br>
<br>
    > Can we somehow make unshare vs chroot an option ?  Or, even better perhaps, detect docker<br>
    > and don't use unshare in that case ?<br>
<br>
Do you know how to detect that the process is running inside docker?<br>
<br>
-- <br>
viele Grüße Thomas<br>
</blockquote></div>

<br>
<p style="margin:0px;background-color:rgb(255,255,255)"><font face="Calibri, sans-serif" color="#aeaaaa"><span style="font-size:14.6667px">Notice: <br>This email is confidential and may contain copyright material of members of the Ocado Group. Opinions and views expressed in this message may not necessarily reflect the opinions and views of the members of the Ocado Group.<br><br>If you are not the intended recipient, please notify us immediately and delete all copies of this message. Please note that it is your responsibility to scan this message for viruses.<br><br>References to the "Ocado Group" are to Ocado Group plc (registered in England and Wales with number 7098618) and its subsidiary undertakings (as that expression is defined in the Companies Act 2006) from time to time. The registered office of Ocado Group plc is Buildings One & Two, Trident Place, Mosquito Way, Hatfield, Hertfordshire, AL10 9UL.</span></font></p>