Execute commands inside container on host machine

I need to build a docker image that will execute some commands on the host machine where the docker daemon is running.

For example, When I run the container it has to run the below command on the host machine and if I stop the container it should stop.

RUN nohup bash -c "helm repo index /home/www/eden-repo/ &" && sleep 4

Source: StackOverflow