Docker is
a tool designed to make it easier to create, deploy, and run
applications by using containers. Containers allow a developer to package up an
application with all of the parts it needs, such as libraries and other
dependencies, and ship it all out as one package.
Docker is a bit like a virtual machine. But unlike a virtual
machine, rather than creating a whole virtual operating system, Docker allows
applications to use the same kernel as the system that they're running on
and only requires applications be shipped with things not already running on
the host computer. This gives a significant performance boost and reduces the
size of the application.
Docker is a tool which help containerizing the applications.
It is a computer program that performs OS level virtualization, also known as Containerization.
Application containerization is an OS level virtualization
method to deploy and run distributed applications without launching an entire
virtual machines for each application. Below pic shows the construct and
container engine is actually Docker.
Container doesn’t contain all the VM files but min which is
needed for the app and uses the kernel of the VM that’s why its very small in
size.
Above is the life cycle of the container below are the steps explained and command used :
There is central repo for docker images called dockerhub
just like github.
- Pull
image in your system from docker hub
- Run
the image and it becomes container
- Stop
container or you can remove container
- Do changes
in the image or create your thing and save it with different name now its
different image
- Login
to the docker first by docker login
- Push
the image to the docker hub with the naming convention username/image name
Docker –version
Docker pull < image-name > [ To pull the image from
the repo / hub]
Docker images [ To verify the images downloaded or pull]
Docker run -it -d < image-name > [run the image and
make it a container]
Docker ps [ all the container running state on the server]
Docker ps -a [ show all the container running or not ]
Docker stop <container ID> [ stopping container]
Docker exec -it <container
ID> <bash/powershell>
Docker kill <container
ID> [forcing to stop]
Docker stop <container ID> [ stopping container]
Docker rm <container ID> [ remove container from system ]
Docker rm <images ID>
[ remove images from system ]
Exit to get out of the contaimer
Docker commit <container ID > < give name for image >
Docker push <imageid>
<imagename>
No comments:
Post a Comment