# Day 16 Task: Docker for DevOps Engineers.

### Docker

Docker is an open-source platform that enables developers to build, deploy, run, update and manage containers. Containers are lightweight, standalone, and executable packages of software that can run reliably across different computing environments, such as development, testing, staging, and production.

Docker provides tools and services for building and managing containers, such as Docker Engine, Docker Compose, Docker Swarm, and Docker Hub.

* **Docker Engine** is the core component that enables you to **create and run containers** on your local machine or remote servers.
    
* **Docker Compose** is a tool for **defining and running multi-container** applications.
    
* **Docker Swarm** is a tool for **managing container clusters** and scaling applications.
    
* **Docker Hub** is a cloud-based repository for **storing and sharing container images,** which are the pre-built and packaged versions of applications.
    

**Why we use Docker:**

* container reuse.
    
* container versioning.
    
* Improved and seamless container portability.
    
* shared container libraries.
    
* docker is lightweight.
    

![What is Docker ? How to use it ? - Knoldus Blogs](https://1000logos.net/wp-content/uploads/2021/11/Docker-Logo-2013.png align="left")

# Tasks

As you have already installed Docker in previous days' tasks, now is the time to run Docker commands.

* To get the Docker version
    
    ![](https://cdn.hashnode.com/res/hashnode/image/upload/v1682808993142/abe17bfe-5f6e-49f9-b9f8-aca8d4e29aee.png align="center")
    

* Use the `docker run` command to start a new container and interact with it through the command line. \[Hint: docker run hello-world\]
    
    ![](https://cdn.hashnode.com/res/hashnode/image/upload/v1682807671904/084d98bf-05fe-428f-8fd7-68fbe34006d7.png align="center")
    
    ![](https://cdn.hashnode.com/res/hashnode/image/upload/v1682807693923/07c7c7e4-2654-4088-8d1f-7331af11170f.png align="center")
    
* Use the `docker inspect` command to view detailed information about a container or image.
    
    ![](https://cdn.hashnode.com/res/hashnode/image/upload/v1682807771468/81c46d39-87be-4c11-b443-59226aa3e377.png align="center")
    
* Use the `docker port` command to list the port mappings for a container.
    
    ![](https://cdn.hashnode.com/res/hashnode/image/upload/v1682811878950/e9ea805c-255e-406e-9389-eea8be8c200e.png align="center")
    
    ![](https://cdn.hashnode.com/res/hashnode/image/upload/v1682812117178/0d3779b5-340a-4861-a842-b236beb7cc13.png align="center")
    
    ![](https://cdn.hashnode.com/res/hashnode/image/upload/v1682813378789/f6f90524-8dea-4729-83d0-580a3acf49f9.png align="center")
    
    ![](https://cdn.hashnode.com/res/hashnode/image/upload/v1682812363268/83a6bb65-91c1-4eee-8128-4e602f1acff0.png align="center")
    
* Use the `docker stats` command to view resource usage statistics for one or more containers.
    
    ![](https://cdn.hashnode.com/res/hashnode/image/upload/v1682808202567/6e26ba39-792f-4619-9d16-d2579cfa49e6.png align="center")
    
* Use the `docker top` command to view the processes running inside a container.
    
* ![](https://cdn.hashnode.com/res/hashnode/image/upload/v1682812856152/8e996367-1938-4959-a4af-1b2c84637ea8.png align="center")
    
* ![](https://cdn.hashnode.com/res/hashnode/image/upload/v1682812814996/bb566f9f-2fb7-43be-834c-f082493c337e.png align="center")
    
* Use the `docker save` command to save an image to a tar archive.
    
    ![](https://cdn.hashnode.com/res/hashnode/image/upload/v1682813253880/287e13f6-0bdf-4b69-bbff-afb588e75efe.png align="center")
    
* Use the `docker load` command to load an image from a tar archive.
    
    ![](https://cdn.hashnode.com/res/hashnode/image/upload/v1682813276579/44f7c6a5-f36f-4c4c-b6f6-cb474e5d0324.png align="center")
    

Happy Learning :)

Mohammed Muqafamuddin.
