Saturday, 26 October 2019

Docker Commands


Ctrl+p+Q is used for exit from running containers. After exit, containers still exists.

Top:
It shows top level process within container



Stop:
This command can be used for stop the container


Remove:
This command can be used for remove the docker container.


Stats:
This command can be used for statistics like CPU, Memory usage of container



Attach:
This command can be used for attach container


Pause
This command can be used for pause the process which are running on container



Unpause:
This command can be used for unpause process which is stopped in container


Kill
This command can be used for kill the process in running container



ncenter:
This method allows one to attach to a container without exiting the container.

Remove stopped containers
docker system prune



Detached
With this mode, docker container will be exists with running mode even if we exit from container.

Port Mapping:

-p is for port like data port and control port.
-p 80:80 container port:host port




Docker images
#docker images 

#docker ps -a
#docker ps

docker run


Login to running container
docker exec -it 26f0edf89ftw cmd
Docker commit
docker commit –m “Application installed”  54f04da39fgf app:1.0
After commit, run the image
docker run -it app:1.0 cmd

No comments:

Post a Comment