Please read the previous articles related to azure
From the above image , you can see the list of images complete details inside that
Now, i want to list out all the container details
Now, from the above screenshot you can compare the ids.
You can forcefully delete the container instead of stopping it. By using the below command
docker rm -f containerId or Name
Committing Changes to Docker
Running a Container
Running of containers is managed with the Docker run command. To run a container in an interactive mode, first launch the Docker container.
Syntax: sudo docker run –it centos /bin/bash
Now, let us exec the command using bash
docker exec -it test123 bash
From the above image you can see once you have runned the command, It has changed the root ip to the container id.
Type ls command to list the files inside it
root@83059965016c:/# mkdir demo123
root@83059965016c:/demo123# echo "This is my tes file">sample.txt
root@83059965016c:/demo123# ls
root@83059965016c:/demo123# exit
docker images -q
This command is used to return only the Image ID’s of the images.
docker inspect
This command is used see the details of an image or container.
Syntax
docker history
With this command, you can see all the commands that were run with an image via a container.
docker history ImageID
docker stop
This command is used to stop a running container.
Syntax
docker stop ContainerID
docker rm
This command is used to delete a container.
Syntax
docker rm ContainerID
docker stats
This command is used to provide the statistics of a running container.
docker stats ContainerID
docker pause
This command is used to pause the processes in a running container.
docker pause ContainerID
docker unpause
This command is used to unpause the processes in a running container.
docker kill
This command is used to kill the processes in a running container.
docker kill ContainerID
Docker – Container Lifecycle
The following illustration explains the entire lifecycle of a Docker container.
Initially, the Docker container will be in the created state.
Then the Docker container goes into the running state when the Docker run command is used.
The Docker kill command is used to kill an existing Docker container.
The Docker pause command is used to pause an existing Docker container.
The Docker stop command is used to pause an existing Docker container.
The Docker run command is used to put a container back from a stopped state to a running state
docker container prune:
This is the command, which will delete all the exited containers.
No comments:
Post a Comment
Thank you for visiting my blog