Docker Containerization Tool and Its Commands.

Docker Containerization Tool and Its Commands.

Docker Containerization

Docker Containerization is the technology that was launched in 2013 by a company called Dotcloud as an open source software development platform.

Docker containers are one of the components of Docker. Containers are the abstraction at the app layer that bundles code and dependencies together so to make sure that your application works seamlessly in any environment which can be developed or test or production. Containers are another form of Virtualization.

Advantages of Docker –

Docker has been very popular nowadays, and therefore it has advantages over virtual machines.

VM-vs-Docker-What-is-Docker-Container-Edureka-1.png

1. Size: The parameter which compare them on their resource they utilize.

2. Startup: This parameter compare them on the basis of their boot time.

3. Integration: This parameter will compare on their ability to integrate with other tools with ease.

Some Docker Commands

1. docker images - This command lists all the stored images locally.

Command-

docker images

Output- docker images.png

2. docker search - This command is used to search the particular image from the dockerHub using command line.

Command-

docker search <image_name>

Output-

docker search.png

3. docker pull -This command is used to pull the particular image from the dockerHub to our local machine.

Command-

docker pull <image_name>

Output-

docker pull.png

4. docker run - This command is used to create a container of a specified image.

Command-

docker run -d <image_name>

This command helps to run container in background.

Output- docker run -d .png

Command-

docker run -it <image_name>

This command helps to run container that allows interaction with the terminal of the specified image.

Output- docker run -it.png

Command-

docker run -p <host_port>:<container_port> <image>

This command publishes the port. Output-

docker run -p.png

Command-

docker run --name <container_name> <image_name> COMMAND

This command helps to assign names to your docker containers.

Output-

docker run --name.png

5. docker ps - This command lists all the running containers.

Command-

docker ps

Output-

docker ps.png

6. docker ps -a - This command is used to show all the running / non-running or all existed containers.

Command-

docker ps -a

Output-

docker ps -a.png

7. docker inspect - This command provides detailed information on constructs controlled by Docker.

Command-

docker inspect <object>

Output-

docker inspect.png

8. docker start - This command is used to start the stopped container that are already existed.

Command-

docker start <container_name>

Output-

docker start.png

9. docker stop - This command is used to stop the current running containers.

Command-

docker stop <container_name>

Output-

docker stop.png

10. docker rm - This command is used to delete the stopped container.

Command-

docker rm <container_id>

Output-

docker rm.png

In the above picture we can see that the after running docker rm command, we cannot find the container named mackiie_cool. This means that the container has been deleted.

Conclusion

These were the few commands which can help you to get started with Docker and can motivate you to explore more about docker and docker containers.

###Happy Learning !!