How can i run docker command inside a docker container?

The solution for me was to chmod /var/run/docker.sock with correct rightd considering that user/group inside container is not the user/group on the host.