Quick Commands
Show running container
docker ps
Run new container
(Also pulls the corresponding image)
docker run -d -t -p <portondockerhost>:<portinsidedockercontainer> --name <containername> <containerimagename>:<containerimageversion>
Download specific container image
docker pull <imagenamefromdockerhub>:<imageversion>
Power options for container
Stop container
docker stop <containername/containerid>
Start container
docker start <containername/containerid>
Restart Container
docker restart <containername/containerid>
Show statistics
docker stats
Delete all stopped container
docker system prune
Show container details
docker inspect <containername/containerid>
Return specific ip address of container
docker inspect -f '{{range.NetworkSettings.Networks}}{{.IPAddress}}{{end}}' <containername/containerid>
Show container logs
docker logs <containername/containerid>
Update container restart behavior
docker update --restart unless-stopped <containername/containerid>