Docker Commands

List of Docker Commands

1) docker –version 
 To get the currently installed version of docker.

2) docker pull
Exp:docker pull
This command is used to pull images from the docker repository.

3)docker run
Exp:docker run -it -d
This command is used to create a container from an image.

4)docker ps
This command is used to list the running containers.

5)docker ps -a
This command is used to show all the running and exited containers in to docker.

6)docker exec
Exp: docker exec -it bash
This command is used to access the running container.

7)docker stop
Exp:docker stop
This command stops a running container with this Id.

8)docker kill
Exp:docker kill
This command kills the container by stop its execution immediately.

9)docker commit
Exp:docker commit
This command creates a new image of an edited container on the local system.

10)docker login
This command is used to login to the docker hub repository.

11)docker push
Exp:docker push
This command is used to push an image to the docker hub repository.

12)docker images
This command lists all the locally stored docker images.

13)docker rm
Exp:docker rm
This command is used to delete a stopped container.

14)docker rmi
Exp:docker rmi
This command is used to delete an image from local storage.

15)docker build
Exp:docker build
This command is used to build an image from a specified docker file.

16)docker help
This command will provide listing all docker command with syntax.

17)docker info
This will show you several pieces of information about the OS.

18)docker search busybox
This command will search the online Docker registry for a Image named busybox.

Docker Architecture


Docker is open platform for developing, shipping and running applications. Docker enables you to separate your applications from you infrastructure/hardware. We can quickly be shipping, testing and deploying code on Server.

Docker Architecture:
Docker uses a client-server architecture. The Docker client and daemon can run on the same system ot we can connect a docker client to a remote Docker daemon.
The docker client and daemon communicate using a REST API, OVER UNIX Sockets or network interface.
Docker Daemon: Docker(dockerd) Object manages images, containers, network and volumes. A daemon can also communicate with other daemons to manage Docker Services.
Docker Client: Docker Client (docker) is the primary way that many Docker Users.When you use commands such as "docker run" this client sends these commands to dockerd and this command uses the Docker API. The Docker client can communicate with more than one daemon.
Docker Registries:
A docker registry store Docker images. Docker HUB and Docker Cloud are public registry that anyone can used. we can run our private registry.


Docker objects:
When you use Docker, you are creating and using images, containers, networks, volumes, plugins, and other objects

IMAGES:
An image is a read-only template with instructions for creating a Docker container.we can create own images or you might only use those created by others and published in a registry.

CONTAINERS :
A container is a runnable instance of an image. You can create, start, stop, move, or delete a container using the Docker API or CLI.