The build stage does neither have a x-server to render graphics output, nor is Chrome installed. Even if you install both, you won’t be able to start them during image builds.
Either switch to the headless mode of your driver or use a headless driver and it should work.
Before you ask how it’s done: I have no Idea, it has been years that I worked with Selenium, and I am surprised that people still use it. I am sure a Google search will help you find out how to either run your driver in headless mode, or use a headless driver.