Maven surefire tests with selenium ChromeDriver fail during image build

I’m using a headless browser, and it runs successfully with pom.xml. However, when running through Docker, it gives a SessionNotCreated exception.

I have tried downloading the chromedriver.exe through Docker commands as well as with requirements.txt, but I am still facing the same issue.