You can still "escape" your docker container with the exec node by ssh'ing onto the host system and attach your command at the end.
I do so with a certificate and a special user with non-root rights in order to do some backup jobs on host level.
I decribed in more details how I am doing it here
EDIT
Aaaand ... if you'd like to run a script which temporarily stops your docker container after you started the script with above mentioned approach, check here to get everything up and running again, as you like.