Docker is an open platform for developing, shipping, and running applications. Docker
enables you to separate your applications from your infrastructure so you can deliver software
quickly. With Docker, you can manage your infrastructure in the same ways you manage your
applications. By taking advantage of Dockers methodologies for shipping, testing, and deploying
code quickly, you can significantly reduce the delay between writing code and running it in
production.
Create and run a container in background
$ docker run -d -p 80:80 docker/getting-started
-d - Run the container in detached mode
-p 80:80 - Map port 80 to port 80 in the container
docker/getting-started - The image to use
Create and run a container in foreground.
$ docker run -it -p 8001:8080 --name my-nginx nginx
-it - Interactive bash mode
-p 8001:8080 - Map port 8001 to port 8080 in the container
--name my-nginx - Specify a name
nginx - The image to use