Hey Learners! Welcome back. In this blog, we're diving into the world of Docker, exploring its benefits, uses and how to use it in DevOps practices. Let's get started.
What is Docker?
Docker is a containerization platform which allows us to package applications and their dependencies into a container which can be run consistently across different environments.
It provides a way to create, distribute and run containerized applications. It is faster and more reliable deployments, improved application, portability and consistency easier management of infrastructure and simplified testing and development workflow.
Unlike a VM a container shared the underlying host OS kernel and only runs the application and its dependencies in an isolated environment. Containers are lightweight, standalone executable packages that contain everything needed to run an application including code runtime, libraries and system tools.
Docker Commands:-
Use the
docker run
command to start a new container and interact with it through the command line.This command is used to run a container from an image. Find the below screenshot which runs a container with a hello-world image. Use
docker run hello-world
.Use the
docker inspect
command to view detailed information about a container or image.To check the information on any image or container, do
docker inspect <container/image_name>
Use the
docker port
command to list the port mappings for a container.List port mappings or specific mapping for a container.
Use the
docker stats
command to view resource usage statistics for one or more containers.Returns live data stream for running containers. Use
docker stats <container-name/ID>
Use the
docker top
command to view the processes running inside a container.Displays running processes f a container. Use
docker top <container-name/ID>
Use the
docker save
command to save an image to a tar archive.Save images to a tar archive. Use
docker save --output <name>.tar <image-name/ID>
Use the
docker load
command to load an image from a tar archive.Load an image from the tar archive file. Use
docker image load -i <path/to/tar/file>
Thank you so much for taking the time to read till the end! Hope you found this blog informative and helpful for remembering the concept of Docker and some useful commands for the docker.
Feel free to explore more of my content, and don't hesitate to reach out if need any assistance from me or in case of you have any questions.
Find me on:- Hashnode LinkedIn Github
Happy Learning!