[Newbie] Find Docker version from within a Docker container?

Perhaps my Google-Fu is not strong, but I attempted to find the answer to this for a couple of days now. BTW, I’m running Linux with BusyBox, running Jenkins within a Docker Container.

Is there a way to pull Docker version info from within the container itself? I found a way to reliably pull the container ID with the following command: cat /proc/self/cgroup | grep docker | grep -o -E ‘[0-9a-f]{64}’ | head -n 1

But, is there a way (from within the container) to map the container ID to a Docker version? If I’m missing something obvious, please forgive me.

Thank you.

It might be a bit of an overkill but you can run a docker client inside the container and mount the docker socket
/var/run/docker.sock so you can run command on the docker daemon installed on the host itself.

there is a docker image on the hub for this
https://hub.docker.com/_/docker/

and also you might useful this step by step tutorial I did for Jenkins and docker pipeline