Skip to content

sunghac/os-course-docker

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 

Repository files navigation

OS Course Docker Environment

This repository provides a reproducible Linux development environment for the Operating Systems course.
You do NOT need to install gcc, gdb, or other development tools on your host OS. All tools are provided inside a Docker container.

Environment Overview

  • Base image: ubuntu:22.04

  • Architecture: Automatically matches your Docker platform

    • Apple Silicon (M1/M2/M3) → ARM64
    • Intel Mac / Windows → x86_64
  • Your local workspace/ directory is mounted into the container at:

/workspace
  • Files stored in workspace/ persist on your machine even after the container exits.

Prerequisites

Install Docker Desktop for your platform:

Getting Started

1. Build the image

docker compose build

2. Start the container

docker compose up -d

3. Connect to the container

docker exec -it os-lab bash

This opens a Linux shell inside the container. The workspace/ folder on your local machine is mounted to /workspace in the container, so any files you edit locally are immediately available inside the container.

When you're done working, simply type exit. The container keeps running in the background, so you can reconnect at any time with the same docker exec command.

4. Stop and remove the container

When you no longer need the environment (e.g., end of semester), stop and remove it:

docker compose down

Note: Files in workspace/ are stored on your local machine and will NOT be deleted.

5. Build and run your code (inside the container)

cd /workspace
gcc -o my_program my_program.c
./my_program

Included Tools

Tool Purpose
gcc, g++ C/C++ compilation
make, cmake Build systems
python3 Python execution
gdb Debugging
valgrind Memory leak detection
strace System call tracing
man Manual pages (POSIX)

Useful Commands

# Process Inspection
ps aux                      # List all running processes
htop                        # Real-time process monitor
pstree                      # Show process tree hierarchy
cat /proc/<PID>/status      # Detailed process status
cat /proc/<PID>/maps        # Process memory map

# Memory Inspection
free -h                     # System memory usage
cat /proc/meminfo           # Detailed memory info

# File Descriptors
lsof -p <PID>              # List open file descriptors

# Signals
kill -l                    # List all signals
kill -9 <PID>              # Send SIGKILL to a process

# Trace system calls
strace ./my_program

# Check for memory leaks
valgrind --leak-check=full ./my_program

# Debug with gdb
gdb ./my_program

# Read manual pages
man fork
man pthread_create
man pipe

Troubleshooting

TBA

About

Docker environment for OS course assignments

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors