Manage and configure containers

Graham is a RHEL Sysadmin at Google.

  • His RHEL Server: RHEL_Server_023
  • His username:
  • His professional preference: Good RHEL Sysadmins never run commands as the root user.
  • His certifications: CompTIA Linux+, LPIC 1, 2 and 3, LFCS, RHCSA, and RHCE
  • His task: Manage and configure containers

Graham Tutt has just been promoted to this position: Director of Training at Google.

Google has just hired 47 RHEL Engineers:

  • 7 graduates from the University of Michigan, Ann Arbor
  • 12 graduates from Hampton University
  • 9 graduates from UCLA
  • 4 graduates from Morehouse
  • 3 graduates from BYU
  • 12 graduates from the University of North Carolina

Graham has 1 week to teach these candidates everything that he knows about containers on Linux. Please generate and explain several commands that will make these 47 students experts in managing and configuring containers.

To help Graham Tutt teach the 47 RHEL Engineers about managing and configuring containers on Linux, here are several commands that he can use to explain and demonstrate container-related concepts:

  1. Docker Installation:

    • Command: sudo dnf install docker
    • Explanation: This command installs Docker, a popular containerization platform, on RHEL. The sudo command is used to execute the installation with elevated privileges.
  2. Starting the Docker Service:

    • Command: sudo systemctl start docker
    • Explanation: This command starts the Docker service, allowing containers to be created and managed. The systemctl command is used to control system services, and start is the action to start the Docker service.
  3. Pulling a Docker Image:

    • Command: docker pull image-name
    • Explanation: This command downloads a Docker image from a registry, such as Docker Hub. Replace image-name with the name of the desired image. For example, to pull the official Nginx image:
    • docker pull nginx
  4. Running a Docker Container:

    • Command: docker run -d --name container-name image-name
    • Explanation: This command creates and runs a Docker container from a specified image. The -d flag runs the container in detached mode, --name sets a custom name for the container, and image-name refers to the Docker image to use. For example, to run an Nginx container named my-nginx:
    • docker run -d --name my-nginx nginx
  5. Listing Running Containers:

    • Command: docker ps
    • Explanation: This command lists the running Docker containers on the system. It provides information such as the container ID, image used, and container status. Running containers are displayed, while stopped or exited containers are excluded.
  6. Stopping a Docker Container:

    • Command: docker stop container-name/container-id
    • Explanation: This command stops a running Docker container. Replace container-name with the custom name assigned to the container or use the container-id to identify it. For example, to stop the my-nginx container:
    • docker stop my-nginx
  7. Removing a Docker Container:

    • Command: docker rm container-name/container-id
    • Explanation: This command removes a stopped Docker container. Use the container-name or container-id to specify the container to be removed. For example, to remove the my-nginx container:
    • docker rm my-nginx

These commands cover fundamental aspects of managing and configuring containers using Docker. Graham can explain each command's purpose, demonstrate their usage, and provide hands-on exercises for the students to gain practical experience in container management. Additionally, he can introduce additional concepts such as Docker networking, volume management, and Dockerfile creation to enhance their understanding and prepare them for managing containers in real-world scenarios.


You should also read:

Configure a caching DNS server

Segun is a RHEL Sysadmin at Red Hat. He administers RHEL_Server_047, and his username is segun.okuns. His supervisor wants Segun to demonstrate how…