# -t flag assigns a pseudo-tty or terminal inside our new container # -i flag allows us to make an interactive connection by grabbing the standard in (STDIN) of the container docker run -t -i ubuntu /bin/bash # -d flag tells Docker to run the container and put it in the background, to daemonize it docker run -d ubuntu /bin/sh -c "while true; do echo hello world; sleep 1; done" docker run -it nginx:latest /bin/bash # -P flag is new and tells Docker to map any required network ports inside our container to our host # -p 80:5000 map port 5000 inside our container to port 80 on our local host docker run -p 127.0.0.1:80:8080/tcp ubuntu bash docker run -p 80:80 -v /data:/data -d nginx:latest docker run -P -d nginx:latest