Google chrome is getting crashed when running selenium tests on docker

I am getting the following error when running selenium c# tests on docker windows. Could anyone help me on this. Thank you

OpenQA.Selenium.WebDriverException : unknown error: Chrome failed to start: crashed.
  (chrome not reachable)
  (The process started from chrome location C:\Program Files\Google\Chrome\Application\chrome.exe is no longer running, so ChromeDriver is assuming that Chrome has crashed.)
TearDown : System.NullReferenceException : Object reference not set to an instance of an object.
   at OpenQA.Selenium.Remote.RemoteWebDriver.UnpackAndThrowOnError(Response errorResponse)
   at OpenQA.Selenium.Remote.RemoteWebDriver.Execute(String driverCommandToExecute, Dictionary`2 parameters)
   at OpenQA.Selenium.Remote.RemoteWebDriver.StartSession(ICapabilities desiredCapabilities)
   at OpenQA.Selenium.Remote.RemoteWebDriver..ctor(ICommandExecutor commandExecutor, ICapabilities desiredCapabilities)
   at OpenQA.Selenium.Chrome.ChromeDriver..ctor(ChromeDriverService service, ChromeOptions options, TimeSpan commandTimeout)
   at SeleniumCore.Core.Chrome.Initialize() in C:\src\SeleniumCore\Core\Chrome.cs:line 58

The code which initializes the chrome is shown below:

public class Chrome : IBrowser
        public RemoteWebDriver MainDriver { get; private set; }
        private readonly bool Headless;

        public Chrome(AppConfigContext context)
            Headless = context.Headless;

        /// <summary>
        /// Initialize Chrome Browser Instance.
        /// </summary>
        public void Initialize()
            ChromeOptions options = new ChromeOptions();

            if (Headless)            

            var downloadPath = Controls.DataFilePath + @"Downloads";


            options.AddUserProfilePreference("download.default_directory", downloadPath);
            options.AddUserProfilePreference("download.prompt_for_download", false);
            options.AddUserProfilePreference("disable-popup-blocking", "true");

            RemoteWebDriver driver = new ChromeDriver(@"C:\Chromedrivers\new",options);
            MainDriver = driver;

The docker info which I am using :

 Context:    default
 Debug Mode: false
  buildx: Docker Buildx (Docker Inc., v0.7.1)
  compose: Docker Compose (Docker Inc., v2.2.1)
  scan: Docker Scan (Docker Inc., v0.14.0)

 Containers: 5
  Running: 0
  Paused: 0
  Stopped: 5
 Images: 50
 Server Version: 20.10.11
 Storage Driver: windowsfilter
 Logging Driver: json-file
  Volume: local
 Network: ics internal l2bridge l2tunnel nat null overlay private transparent
  Log: awslogs etwlogs fluentd gcplogs gelf json-file local logentries splunk syslog
 Swarm: inactive
 Default Isolation: hyperv
 Kernel Version: 10.0 19042 (19041.1.amd64fre.vb_release.191206-1406)
 Operating System: Windows 10 Pro Version 2009 (OS Build 19042.1466)
 OSType: windows
 Architecture: x86_64
 CPUs: 4
 Total Memory: 7.886GiB
 Docker Root Dir: C:\ProgramData\Docker
 Debug Mode: false
 Experimental: false
 Insecure Registries:
 Live Restore Enabled: false
 Product License: Community Engine

I edited your post to make the code readable, but I left the spoilers there, although I don’t know why you make it harder to read. Please always use the </> button to share codes when you edit your post.

Have you tried to run the command directly from Windows command line?