Can´t access Chrome browser from Java application inside the same container

I try to run a java application that should connect to a Chrome browser and do some tests.
I am not using selenium. Instead I am using CPD4J 3.0.15.

I can get everything to work when running locally on my windows machine but when I try to run it in a docker container I only get: Caused by: io.webfolder.cdp.exception.CdpException: Unable to connect to the browser
My Dockerfile looks like this:

#FROM debian:bullseye-slim
FROM openjdk:17-ea-jdk-buster

COPY target/testapp-0.0.1-SNAPSHOT.jar testapp-0.0.1.jar

USER root
RUN apt-get update && apt-get install -y apt-transport-https
ca-certificates curl gnupg2
RUN curl -fsSL https :// | apt-key add -
RUN apt-key fingerprint 0EBFCD88
RUN add-apt-repository
“deb [arch=amd64] https ://
$(lsb_release -cs) stable”
RUN apt-get update && apt-get install -y docker-ce-cli
RUN apt-get update && apt-get install -y wget
RUN wget -q -O - https :// | apt-key add -
RUN echo “deb http :// stable main” > /etc/apt/sources.list.d/google.list
RUN apt-get update
RUN apt-get install -y google-chrome-stable xvfb
ENV CHROME_BIN=‘/usr/bin/google-chrome-stable’

Expose port 9222


ENTRYPOINT [“java”,“-jar”,“/testapp-0.0.1.jar”]

Can someone please assist me in what I am doing wrong in the Dockerfile?
I have no idea how to really do this and have google around and tried many different setups in the Dockerfile.
Sorry for the space after http but I was only allowed to post one link in my question.