Cat command passed into DIND run command breaks daemon connection

Hello. Could anyone help me figure out why a command is breaking my dind?

Context:
I want to run dind as a jenkins agent to build application containers and still be isolated from the machine running jenkins. The jenkins docker agent integration a command breaks the connect to the docker daemon. This is what it generates:
docker run -t -d -u 1035:1039 -u 0 --name dind --rm --privileged --network host -e DOCKER_TLS_CERTDIR=/certs -v dind-certs-ca:/certs/ca -v dind-certs-client:/certs/client docker:dind cat

The command I have that is known to work is:
docker run -t -d -u 1035:1039 -u 0 --name dind --rm --privileged --network host -e DOCKER_TLS_CERTDIR=/certs -v dind-certs-ca:/certs/ca -v dind-certs-client:/certs/client docker:dind

Problem:
The cat command being passed in breaks it. As far as I know there is no way to prevent it from doing this while still using the container integration. The error I get is the standard can’t connect to daemon:
Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running?

This is really strange to me that it would break because in the docker file there is:

ENTRYPOINT ["dockerd-entrypoint.sh"]
CMD []

Thanks in advance.

You should check dockerd-entrypoint.sh what is does with the cat command you pass to it.

I don’t think the doc mentions that you can pass an argument, besides options.

It’s depending on the entrypoint file if you can just pass a sh command as parameter.

I’m not sure what you expect. The dind image would run the docker daemon which you override with the cat command. I thnk some details are missing here like what exactly throws the error, but I’m pretty sure it is not the quoted cat command itself, but the fact that you don’t run the docker daemon and something wants to connect to it.