# run with connected bash with closing after exit
docker run -it --name ubuntu ubuntu:16.04 /bin/bash
# run in detached mode
docker run -id --name ubuntu ubuntu:16.04
docker exec -it ubuntu /bin/bash
# run in detached mode with mounted directories
docker run -v /dir-on-host:/dir-in-container -id --name ubuntu ubuntu:16.04
docker exec -it ubuntu /bin/bash