DEV Community

Cover image for Space Container Inspection: Secure Your Futuristic City
Labby for LabEx

Posted on

Space Container Inspection: Secure Your Futuristic City

Introduction

This article covers the following tech skills:

Skills Graph

In this lab, you will be transported to a futuristic space city where you take on the role of a space police officer. Your mission is to inspect and investigate suspicious Docker containers that might be posing security threats within the space city.

Explore Container Information

In this step, you will learn how to inspect a Docker container to retrieve detailed information about it.

  1. Start by running a Docker image as a container:
   docker run -d --name my_container alpine sh -c "while true; do echo hello world; sleep 1; done"
Enter fullscreen mode Exit fullscreen mode
  1. Next, inspect the created container to retrieve its details:
   docker inspect my_container
Enter fullscreen mode Exit fullscreen mode

This command will provide a comprehensive JSON output containing information about the container, such as its configuration, network settings, and mounts.

Examine Container Networks

In this step, you will delve into the networking details of a Docker container.

  1. Firstly, connect to a sample network using the following command:
   docker network create my_network
Enter fullscreen mode Exit fullscreen mode
  1. Then, launch a new container and connect it to the created network:
   docker run -d --name my_network_container --network my_network alpine sleep 1d
Enter fullscreen mode Exit fullscreen mode
  1. Now, inspect the network configuration to obtain network-specific information:
   docker network inspect my_network
Enter fullscreen mode Exit fullscreen mode

This will provide a detailed breakdown of the network, including its subnets, containers connected, and other relevant details.

Summary

In this lab, you have simulated the role of a space police officer and explored the docker inspect command to gather crucial information about Docker containers. By inspecting container and network configurations, you have gained insights into their internal workings, thus enhancing your Docker proficiency.

MindMap


🚀 Practice Now: Space Container Inspection


Want to Learn More?

Top comments (0)