Module 7 - Docker

Lab 1: Create & Run a Basic Docker Container

  1. How do you create a Docker container using an Ubuntu base image?

  2. How do you run a simple “Hello World” script inside the container?


Lab 2: Build a Custom Nginx Image

  1. How do you write a Dockerfile that builds a custom Nginx image?

  2. How do you configure that image to serve a static HTML page?


Lab 3: Create a Multi-Stage Dockerfile

  1. How do you create a multi-stage Dockerfile to build a lightweight Go application?

  2. How do you create a multi-stage Dockerfile for a lightweight Python application?

  3. How do you create a multi-stage Dockerfile for a lightweight Node.js application?

  4. How do you verify that the resulting image is smaller than the non-multi-stage version?


Lab 4: Optimize Docker Image Size

  1. How do you reduce Docker image size using an Alpine base image?

  2. How do you remove build cache or unnecessary packages inside a Dockerfile?

  3. How do you compare the Docker image sizes before and after optimization?


Lab 5: Multi-Container App With Docker Compose

  1. How do you create a Docker Compose file that runs a web container and a database container?

  2. How do you test the network connectivity between the two containers?


Lab 6: Push/Pull Images Using a Private Registry

  1. How do you tag and push a Docker image to DockerHub or a private registry?

  2. How do you pull the same image back from the registry to another system or environment?


Lab 7: Deploy a Containerized Application

  1. How do you deploy a containerized application using docker run?

  2. How do you deploy it using Docker Compose?

  3. How do you verify that the application is running correctly?


Lab 8: Configure Docker Networking

  1. How do you create a user-defined bridge network in Docker?

  2. How do you attach multiple containers to that network?

  3. How do you test communication between containers on that network?


Lab 9: Use Docker Volumes for Persistence

  1. How do you create a Docker volume for a MySQL or PostgreSQL database?

  2. How do you attach the volume to the database container?

  3. How do you verify that data persists across container restarts or deletion?


Lab 10: Implement Docker Health Checks

  1. How do you add a HEALTHCHECK instruction inside a Dockerfile?

  2. How do you view the health status of a running container?

  3. How do you test Docker’s auto-restart or unhealthy → restart behavior?

Last updated