My jenkins job getting error while pushing the docker image to docker hub

Never do this. That file is protected for a reason. Making accessible to everyone is a security risk as everyone with access to the docker socket basically has full root access to your host.

regarding your problem, a little context would be helpful. You shared that docker says “permission denied” but Docker always tells you what it wanted to access. Without that there is not much we can say. We also don’t know how you installed Jenkins. Is it running on the host or in a container?

The title of your question indicates you have problem with pushing the image but in the content you mention building and pushing and you change the docker socket which is always needed by Docker.

Please, always share the full error message and when you do that format your post according to this guide: How to format your forum posts