Running instances of images.
Features
- Very light weight (less resources are used)
- Booting of container is very fase
- can easily, start, stop and kill a container.
docker run --name MyUbuntu1 -it ubuntu
Usage - will run a image and give it name as well.
docker pause MyUbuntu1
(docker pause <Container Id | name>)
Usage - It will basically pause the container. (Even if you type something, it wont show)
docker unpause MyUbuntu1
Usage - It will run all the commands which were executed after the container was stopped.
docker top <container name | id>
Usage - Display the running processes of a container.
docker stats <container name | id>
Usage - Will display a live stream of container resource usage stats.
docker attach <container name | id>
Usage - will attach to a running container. (if you exit, all the other terminals where this container is being run will also be exited).
can be used in this way as well
docker start MyUbuntu1
docker attach MyUbuntu1
or
docker start RahulUbuntu -i
docker kill RahulUbuntu
Usage - Kill one or more running containers.
docker rm MyUbuntu1
Usage - Remove a container. (add -f to remove a running container)
docker history ubuntu
Usage - Will show history of the image