Skip to content

Ticket #13: Add Dockerfile for health-check.sh #53

Description

@PuneethM-06

Description

Containerize the linux-sysmonitor health-check script so it can run identically on any machine with Docker installed, without requiring Bash or other dependencies on the host.


Tasks

  • Create a Dockerfile in the project root.
  • Choose an appropriate base image (alpine:3.19 recommended for its small size) and document the reason in the README or commit.
  • Install all required packages (e.g., bash, curl, etc.).
  • Copy the project files into /app inside the image.
  • Set the working directory using WORKDIR /app.
  • Make the script executable (chmod +x health-check.sh).
  • Define the container entry point:
    ENTRYPOINT ["./health-check.sh"]
  • Build the image:
    docker build -t linux-sysmonitor:v1 .
  • Run the container and verify it produces the same output as the native script:
    docker run --rm linux-sysmonitor:v1

Acceptance Criteria

  • Docker image builds successfully without errors.
  • Container starts successfully using the configured ENTRYPOINT.
  • Output matches the native execution of health-check.sh.
  • No host-side Bash or additional dependencies are required.
  • Dockerfile follows Docker best practices and is easy to understand.

Commit Message

feat: add basic Dockerfile for health-check script (closes #13)

Why This Matters

This is the foundation of Docker-based application packaging. Completing this ticket will help you understand:

  • Selecting an appropriate base image.
  • Installing dependencies inside a container.
  • Docker image layers and build caching.
  • COPY and WORKDIR.
  • The difference between ENTRYPOINT and CMD.
  • Building portable, reproducible environments.

Interview Tip: Be prepared to explain why you chose each Dockerfile instruction—not just what it does. Questions about base image selection, layer caching, and ENTRYPOINT vs CMD are very common in Docker interviews.

Metadata

Metadata

Assignees

Labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions