While attached to a running container with a pty assigned (docker run -it ...), you can press ControlP - ControlQ to detach.
docker run -it ...