title: Selenium docker crashes on Windows (unknown error: DevToolsActivePort file doesn't exist)
body: <p>Summary: works on the mac but not on windows. Please note: This is not a duplicate of other similar issues, I have researched this for more than a day on SO and elsewhere.</p>
  <p>I built a super simple script which executes 2 dockers containers: one with chrome browser, chromedriver and the other with the test. It runs fine on Linux, but when I launch the containers on Windows I'm getting;</p>
  <pre><code>root@4ba2401510ed:/wdir# ../usr/bin/php7.1 chromeTest.php
  PHP Fatal error:  Uncaught Facebook\WebDriver\Exception\UnknownErrorException: unknown error: Chrome failed to start: crashed.
    (unknown error: DevToolsActivePort file doesn't exist)
    (The process started from chrome location /usr/bin/google-chrome is no longer running, so ChromeDriver is assuming that Chrome has 
  crashed.)
  Build info: version: '3.141.59', revision: 'e82be7d358', time: '2018-11-14T08:25:53'
  System info: host: '5cc73cb1d7df', ip: '172.18.0.2', os.name: 'Linux', os.arch: 'amd64', os.version: '5.4.72-microsoft-standard-WSL2', java.version: '1.8.0_282'
  Driver info: driver.version: unknown
  remote stacktrace: #0 0x564b66a6ce89 &lt;unknown&gt;
   in /wdir/vendor/php-webdriver/webdriver/lib/Exception/WebDriverException.php:139
  Stack trace:
  #0 /wdir/vendor/php-webdriver/webdriver/lib/Remote/HttpCommandExecutor.php(371): Facebook\WebDriver\Exception\WebDriverException::throwException('unknown error', 'unknown error: ...', Array)
  #1 /wdir/vendor/php-webdriver/webdriver/lib/Remote/RemoteWebDriver.php(135): Facebook\WebDriver\Rem in /wdir/vendor/php-webdriver/webdriver/lib/Exception/WebDriverException.php on line 139
  </code></pre>
  <p>Has anyone seen this before? It looks like Docker just behaves differently on Windows and makes the Chrome inside the docker container crash..</p>
  <p>I tried proposed solutions such as adding <code>--headless</code>, <code>--sandbox</code>, etc. but it really seems to be something with the way docker works on windows.</p>
  <h2>Yaml file</h2>
  <pre><code>version: '3.4'
  
  services:
  
    # Contains the chrome browser, chromedriver
    chrome:
      image: selenium/standalone-chrome-debug
      volumes:
        - /dev/shm:/dev/shm
      ports:
        - &quot;4444:4444&quot;
        - &quot;5900:5900&quot;
  
    # Contains PHP webdriver library
    php7:
      build:
        context: .
        dockerfile: ./Dockerfile
      volumes:
        - .:/wdir/
      depends_on:
        - chrome
      command: tail -F anything
  </code></pre>
  <h2>Dockerfile</h2>
  <pre><code>FROM scratch
  ADD ubuntu-xenial-core-cloudimg-amd64-root.tar.gz /
  ADD start.sh /
  # Chromium DEB file
  #ADD google-chrome-stable_90.0.4430.85-1_amd64.deb /
  #ADD chromedriver /
  # ADD firefox_88.0-1_i386.deb /
  
  # a few minor docker-specific tweaks
  # see https://github.com/docker/docker/blob/9a9fc01af8fb5d98b8eec0740716226fadb3735c/contrib/mkimage/debootstrap
  RUN set -xe \
    \
  # https://github.com/docker/docker/blob/9a9fc01af8fb5d98b8eec0740716226fadb3735c/contrib/mkimage/debootstrap#L40-L48
    &amp;&amp; echo '#!/bin/sh' &gt; /usr/sbin/policy-rc.d \
    &amp;&amp; echo 'exit 101' &gt;&gt; /usr/sbin/policy-rc.d \
    &amp;&amp; chmod +x /usr/sbin/policy-rc.d \
    \
  # https://github.com/docker/docker/blob/9a9fc01af8fb5d98b8eec0740716226fadb3735c/contrib/mkimage/debootstrap#L54-L56
    &amp;&amp; dpkg-divert --local --rename --add /sbin/initctl \
    &amp;&amp; cp -a /usr/sbin/policy-rc.d /sbin/initctl \
    &amp;&amp; sed -i 's/^exit.*/exit 0/' /sbin/initctl \
    \
  # https://github.com/docker/docker/blob/9a9fc01af8fb5d98b8eec0740716226fadb3735c/contrib/mkimage/debootstrap#L71-L78
    &amp;&amp; echo 'force-unsafe-io' &gt; /etc/dpkg/dpkg.cfg.d/docker-apt-speedup \
    \
  # https://github.com/docker/docker/blob/9a9fc01af8fb5d98b8eec0740716226fadb3735c/contrib/mkimage/debootstrap#L85-L105
    &amp;&amp; echo 'DPkg::Post-Invoke { &quot;rm -f /var/cache/apt/archives/*.deb /var/cache/apt/archives/partial/*.deb /var/cache/apt/*.bin || true&quot;; };' &gt; /etc/apt/apt.conf.d/docker-clean \
    &amp;&amp; echo 'APT::Update::Post-Invoke { &quot;rm -f /var/cache/apt/archives/*.deb /var/cache/apt/archives/partial/*.deb /var/cache/apt/*.bin || true&quot;; };' &gt;&gt; /etc/apt/apt.conf.d/docker-clean \
    &amp;&amp; echo 'Dir::Cache::pkgcache &quot;&quot;; Dir::Cache::srcpkgcache &quot;&quot;;' &gt;&gt; /etc/apt/apt.conf.d/docker-clean \
    \
  # https://github.com/docker/docker/blob/9a9fc01af8fb5d98b8eec0740716226fadb3735c/contrib/mkimage/debootstrap#L109-L115
    &amp;&amp; echo 'Acquire::Languages &quot;none&quot;;' &gt; /etc/apt/apt.conf.d/docker-no-languages \
    \
  # https://github.com/docker/docker/blob/9a9fc01af8fb5d98b8eec0740716226fadb3735c/contrib/mkimage/debootstrap#L118-L130
    &amp;&amp; echo 'Acquire::GzipIndexes &quot;true&quot;; Acquire::CompressionTypes::Order:: &quot;gz&quot;;' &gt; /etc/apt/apt.conf.d/docker-gzip-indexes \
    \
  # https://github.com/docker/docker/blob/9a9fc01af8fb5d98b8eec0740716226fadb3735c/contrib/mkimage/debootstrap#L134-L151
    &amp;&amp; echo 'Apt::AutoRemove::SuggestsImportant &quot;false&quot;;' &gt; /etc/apt/apt.conf.d/docker-autoremove-suggests
  
  # this forces &quot;apt-get update&quot; in dependent images, which is also good
  # (see also https://bugs.launchpad.net/cloud-images/+bug/1699913)
  
  # make systemd-detect-virt return &quot;docker&quot;
  # See: https://github.com/systemd/systemd/blob/aa0c34279ee40bce2f9681b496922dedbadfca19/src/basic/virt.c#L434
  RUN mkdir -p /run/systemd &amp;&amp; echo 'docker' &gt; /run/systemd/container
  
  # Install updates
  RUN apt-get update -y &amp;&amp; apt-get install -y software-properties-common language-pack-en-base \
  \
  # Install Java
  -y default-jre \
  \
  # Install snapd
  -y snapd \
  \ 
  # Install wget
  -y wget \
  -y lsof
  
  # Clean up
  RUN rm -rf /var/lib/apt/lists/*
  
  # Get the PHP library
  RUN LC_ALL=en_US.UTF-8 add-apt-repository ppa:ondrej/php
  
  RUN apt-get -y update &amp;&amp; apt-get install -y \
      php7.1 \
      php7.1-pgsql \
      php-pear \
      php7.1-curl \
      php7.1-sqlite3 \
      php7.1-xml \
      php7.1-bcmath \
      php7.1-zip \
      php7.1-mbstring \
      php-xdebug \
      php7.1-mysqli \
      php-ast
  
  
  # Define the working directory for this container
  WORKDIR /wdir
  
  # RUN chmod +x ./start.sh
  
  CMD [&quot;start.sh&quot;]
  </code></pre>