This is a pretty complex question - what will work best for you depends a lot on your setup.
http://tdongsi.github.io/blog/2017/04/23/docker-out-of-docker/
Internally we generally use the “Docker-out-of-Docker” approach when we run in to this problem - but these situations are not dagster pipeline run in docker trying to run docker from solids