# Docker for DevOps Engineers.

## 📌 Docker

Docker is a software platform that allows you to build, test, and deploy applications quickly. Docker packages software into standardized units called containers that have everything the software needs to run including libraries, system tools, code, and runtime. Using Docker, you can quickly deploy and scale applications into any environment and know your code will run.

## 📌 Task-1 Use the docker run command to start a new container and interact with it through the command line

```basic
docker run hello-world
```

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1691484414135/d5f1b59b-1596-4b6d-b8fc-a07e328e879d.png align="center")

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1691484433595/a305e45e-0004-48d9-8916-30e0ec7f632f.png align="center")

## 📌 Task-2 Use the docker inspect command to view detailed information about a container or image.

```basic
docker inspect <container id>
```

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1691484535685/a09a0810-e4dc-4acf-96d9-02db1b81a49a.png align="center")

## 📌 Task-3 Use the docker port command to list the port mappings for a container.

```basic
docker port <container id/name>
```

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1691486384866/092fe8dc-3d73-496f-ad54-b77d50386d22.png align="center")

## 📌 Task-4 Use the docker stats command to view resource usage statistics for one or more containers.

```basic
docker stats <container id>
```

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1691486442361/b0f7ded3-0d7b-4971-8914-e74755264528.png align="center")

## 📌 Task-5 Use the docker top command to view the processes running inside a container.

```basic
docker top <container id>
```

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1691486512272/06d29010-afda-4b37-aa92-c5d184e5ecc7.png align="center")

## 📌 Task-6 Use the docker save command to save an image to a tar archive.

```basic
docker save -o nginx.tar docker.io/nginx

## -o = to write to a file, instead of STDOUT.
```

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1691487947602/e6a99ce6-87c4-4068-80fa-6aefd9fed983.png align="center")

## 📌 Task -7 Use the docker load command to load an image from a tar archive.

```basic
docker load -i  nginx.tar

## -i =  --input string   Read from tar archive file, instead of STDI
```

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1691488167080/d3491470-a193-4144-994b-88ad656d79f0.png align="center")
