Day 16: Docker for DevOps Engineers

Day 16: Docker for DevOps Engineers

ยท

3 min read

#Day16 of #90DaysofDevops challenge

Click here to view Day 16 Task.

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.

Tasks

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

  • Use the docker run command to start a new container and interact with it through the command line. [Hint: docker run hello-world]

  • Use the docker inspect command to view detailed information about a container or image.

    The 'docker inspect' command is used to display detailed information about a Docker container, image, network, or volume. It provides a comprehensive view of the selected object, including its configuration, networking, storage, and other metadata.

    The syntax of the docker inspect command is as follows:

    docker inspect [OPTIONS] <OBJECT>

  • Use the docker port command to list the port mappings for a container.

    The 'docker port' command is used to display the public-facing port that is mapped to a container's private port. When a container is created, it can expose one or more ports to the host machine or other containers in the same network.

    The syntax of the docker port command is as follows:

    docker port <CONTAINER> [<PRIVATE_PORT>/[tcp|udp]]

  • Use the docker stats command to view resource usage statistics for one or more containers.

    The 'docker stats' command is used to display real-time performance statistics for all running Docker containers or for a specific container. It provides detailed information about the container's CPU usage, memory consumption, network I/O, and block I/O, among other metrics.

    The syntax of the docker stats command is as follows:

    docker stats [OPTIONS] [CONTAINER...]

  • Use the docker top command to view the processes running inside a container.

    The 'docker top' command is used to display the running processes inside a Docker container. It provides a quick way to check the status of a container and its processes and to troubleshoot any issues related to the container's processes.

    The syntax of the docker top command is as follows:

    docker top <CONTAINER> [ps OPTIONS]

  • Use the docker save command to save an image to a tar archive.

    The 'docker save' command is used to save one or more Docker images to a tar archive file. This file can then be transferred to another Docker host or registry, and loaded using the 'docker load' command.

    The syntax of the docker save command is as follows:

    docker save [OPTIONS] IMAGE [IMAGE...]

  • Use the docker load command to load an image from a tar archive.

    The 'docker load' command is used to load one or more Docker images from a tar archive file created using the 'docker save' command.

    The syntax of the docker load command is as follows:

    docker load [OPTIONS]

Thank you for reading! ๐Ÿ

Nidhi

ย