10 Basic Command for docker

10 Basic Command for docker

What is Docker ?

Docker is a open source platform for developing , shipping and running your application. It helps you to separate your application from your infrastructure so that you can deliver you application quickly. By using docker you can reduce time between writing the code and running it into production. With docker you can package and run your application in a isolated environment called container. Isolation of containers allow you to run multiple containers on a host machine simultaneously .

What is Docker Image ?

A Docker image is a read-only template that contains a set of instructions for creating a container that can run on the Docker platform. It provides a convenient way to package up applications and preconfigured server environments, which you can use for your own private use or share publicly with other Docker users.

Docker images are also the starting point for anyone using Docker for the first time.

10 docker commands

  1. docker --version

--This command is used to check the current version of the docker installed in your system

Screenshot (143).png 2.

docker pull

--This command is used to pull (download) images from the docker hub into your system. Screenshot (147).png

3.

docker images

--This command will show all the docker images present in your system.

Screenshot (146).png

4.

docker ps

--This command is used to display all the running containers.

Screenshot (148).png

5.

docker run

--This command is used to run container from the locally stored images. If the image is not present locally it will pull the image first then run the container.

Screenshot (145).png 6.

docker inspect

--This command will return returns detailed, low-level information on Docker object.Here you can enter image id by using docker image command.

Screenshot (149).png 7.

docker search

--This command is used to search Docker Hub for the images.

Screenshot (144).png

8.

docker stop

--This command is used to stop the running container.

9.

docker start

--This command is used to start a container which has already been created.

10.

docker rm

--This command is used to delete the container if it is not running.