title: How to setup chrome sandbox on docker container?
body: <p>I am trying to run chrome on a docker container, but I can't properly set up chrome-sandbox and in every place I search people tell to just disable sandbox by passing <code>--no-sandbox</code>. I feel that's a workaround from same team of &quot;run as root&quot;. This is my dockerfile:</p>
  <pre><code>FROM buster-slim
  
  # install chrome
  RUN adduser --system --group chrome
  RUN apt-get update \
      &amp;&amp; apt-get install -y --no-install-recommends wget \
      &amp;&amp; wget https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb \
      &amp;&amp; apt install -y --no-install-recommends ./google-chrome-stable_current_amd64.deb \
      &amp;&amp; rm google-chrome-stable_current_amd64.deb \
      &amp;&amp; chown root:root -R /opt/google/chrome/ \
      &amp;&amp; chmod 755 -R /opt/google/chrome/ \
      &amp;&amp; chmod 4755 -R /opt/google/chrome/chrome-sandbox
  
  USER chrome
  ENTRYPOINT [&quot;google-chrome&quot;, &quot;--headless&quot;, &quot;--disable-gpu&quot;]
  </code></pre>
  <p>but it crashes with illegal instruction error:</p>
  <pre><code>Failed to move to new namespace: PID namespaces supported, Network namespace supported, but failed: errno = Operation not permitted
  Failed to generate minidump.Illegal instruction (core dumped)
  </code></pre>
  <p>it does not crashes if I pass <code>--no-sandbox</code>.</p>